aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/API/CMakeLists.txt47
-rw-r--r--source/API/SBAddress.cpp413
-rw-r--r--source/API/SBAttachInfo.cpp259
-rw-r--r--source/API/SBBlock.cpp526
-rw-r--r--source/API/SBBreakpoint.cpp1346
-rw-r--r--source/API/SBBreakpointLocation.cpp521
-rw-r--r--source/API/SBBroadcaster.cpp243
-rw-r--r--source/API/SBCommandInterpreter.cpp999
-rw-r--r--source/API/SBCommandReturnObject.cpp456
-rw-r--r--source/API/SBCommunication.cpp383
-rw-r--r--source/API/SBCompileUnit.cpp368
-rw-r--r--source/API/SBData.cpp1324
-rw-r--r--source/API/SBDebugger.cpp1934
-rw-r--r--source/API/SBDeclaration.cpp240
-rw-r--r--source/API/SBError.cpp266
-rw-r--r--source/API/SBEvent.cpp309
-rw-r--r--source/API/SBExecutionContext.cpp149
-rw-r--r--source/API/SBExpressionOptions.cpp232
-rw-r--r--source/API/SBFileSpec.cpp253
-rw-r--r--source/API/SBFileSpecList.cpp147
-rw-r--r--source/API/SBFrame.cpp2710
-rw-r--r--source/API/SBFunction.cpp417
-rw-r--r--source/API/SBHostOS.cpp167
-rw-r--r--source/API/SBInstruction.cpp417
-rw-r--r--source/API/SBInstructionList.cpp174
-rw-r--r--source/API/SBLanguageRuntime.cpp11
-rw-r--r--source/API/SBLaunchInfo.cpp306
-rw-r--r--source/API/SBLineEntry.cpp311
-rw-r--r--source/API/SBListener.cpp576
-rw-r--r--source/API/SBMemoryRegionInfo.cpp122
-rw-r--r--source/API/SBMemoryRegionInfoList.cpp189
-rw-r--r--source/API/SBModule.cpp1100
-rw-r--r--source/API/SBModuleSpec.cpp237
-rw-r--r--source/API/SBPlatform.cpp887
-rw-r--r--source/API/SBProcess.cpp2664
-rw-r--r--source/API/SBQueue.cpp663
-rw-r--r--source/API/SBQueueItem.cpp205
-rw-r--r--source/API/SBSection.cpp394
-rw-r--r--source/API/SBSourceManager.cpp184
-rw-r--r--source/API/SBStream.cpp268
-rw-r--r--source/API/SBStringList.cpp167
-rw-r--r--source/API/SBStructuredData.cpp118
-rw-r--r--source/API/SBSymbol.cpp296
-rw-r--r--source/API/SBSymbolContext.cpp327
-rw-r--r--source/API/SBSymbolContextList.cpp122
-rw-r--r--source/API/SBTarget.cpp4087
-rw-r--r--source/API/SBThread.cpp2579
-rw-r--r--source/API/SBThreadCollection.cpp92
-rw-r--r--source/API/SBThreadPlan.cpp314
-rw-r--r--source/API/SBType.cpp1219
-rw-r--r--source/API/SBTypeCategory.cpp927
-rw-r--r--source/API/SBTypeEnumMember.cpp224
-rw-r--r--source/API/SBTypeFilter.cpp238
-rw-r--r--source/API/SBTypeFormat.cpp237
-rw-r--r--source/API/SBTypeNameSpecifier.cpp169
-rw-r--r--source/API/SBTypeSummary.cpp717
-rw-r--r--source/API/SBTypeSynthetic.cpp269
-rw-r--r--source/API/SBUnixSignals.cpp213
-rw-r--r--source/API/SBValue.cpp3182
-rw-r--r--source/API/SBValueList.cpp366
-rw-r--r--source/API/SBVariablesOptions.cpp293
-rw-r--r--source/API/SBWatchpoint.cpp394
-rw-r--r--source/API/SystemInitializerFull.cpp631
-rw-r--r--source/API/liblldb-private.exports6
-rw-r--r--source/Breakpoint/Breakpoint.cpp1779
-rw-r--r--source/Breakpoint/BreakpointID.cpp169
-rw-r--r--source/Breakpoint/BreakpointIDList.cpp634
-rw-r--r--source/Breakpoint/BreakpointList.cpp350
-rw-r--r--source/Breakpoint/BreakpointLocation.cpp1114
-rw-r--r--source/Breakpoint/BreakpointLocationCollection.cpp272
-rw-r--r--source/Breakpoint/BreakpointLocationList.cpp503
-rw-r--r--source/Breakpoint/BreakpointOptions.cpp692
-rw-r--r--source/Breakpoint/BreakpointResolver.cpp442
-rw-r--r--source/Breakpoint/BreakpointResolverAddress.cpp266
-rw-r--r--source/Breakpoint/BreakpointResolverFileLine.cpp213
-rw-r--r--source/Breakpoint/BreakpointResolverFileRegex.cpp228
-rw-r--r--source/Breakpoint/BreakpointResolverName.cpp684
-rw-r--r--source/Breakpoint/BreakpointSite.cpp315
-rw-r--r--source/Breakpoint/BreakpointSiteList.cpp342
-rw-r--r--source/Breakpoint/Stoppoint.cpp23
-rw-r--r--source/Breakpoint/StoppointCallbackContext.cpp27
-rw-r--r--source/Breakpoint/StoppointLocation.cpp38
-rw-r--r--source/Breakpoint/Watchpoint.cpp656
-rw-r--r--source/Breakpoint/WatchpointList.cpp407
-rw-r--r--source/Breakpoint/WatchpointOptions.cpp282
-rw-r--r--source/CMakeLists.txt103
-rw-r--r--source/Commands/CommandCompletions.cpp1063
-rw-r--r--source/Commands/CommandObjectApropos.cpp158
-rw-r--r--source/Commands/CommandObjectApropos.h15
-rw-r--r--source/Commands/CommandObjectArgs.cpp388
-rw-r--r--source/Commands/CommandObjectArgs.h70
-rw-r--r--source/Commands/CommandObjectBreakpoint.cpp4301
-rw-r--r--source/Commands/CommandObjectBreakpoint.h34
-rw-r--r--source/Commands/CommandObjectBreakpointCommand.cpp1204
-rw-r--r--source/Commands/CommandObjectBreakpointCommand.h13
-rw-r--r--source/Commands/CommandObjectBugreport.cpp176
-rw-r--r--source/Commands/CommandObjectBugreport.h7
-rw-r--r--source/Commands/CommandObjectCommands.cpp3631
-rw-r--r--source/Commands/CommandObjectCommands.h13
-rw-r--r--source/Commands/CommandObjectDisassemble.cpp1026
-rw-r--r--source/Commands/CommandObjectDisassemble.h120
-rw-r--r--source/Commands/CommandObjectExpression.cpp1092
-rw-r--r--source/Commands/CommandObjectExpression.h145
-rw-r--r--source/Commands/CommandObjectFrame.cpp1119
-rw-r--r--source/Commands/CommandObjectFrame.h10
-rw-r--r--source/Commands/CommandObjectGUI.cpp65
-rw-r--r--source/Commands/CommandObjectGUI.h12
-rw-r--r--source/Commands/CommandObjectHelp.cpp428
-rw-r--r--source/Commands/CommandObjectHelp.h157
-rw-r--r--source/Commands/CommandObjectLanguage.cpp14
-rw-r--r--source/Commands/CommandObjectLanguage.h22
-rw-r--r--source/Commands/CommandObjectLog.cpp705
-rw-r--r--source/Commands/CommandObjectLog.h21
-rw-r--r--source/Commands/CommandObjectMemory.cpp3199
-rw-r--r--source/Commands/CommandObjectMemory.h7
-rw-r--r--source/Commands/CommandObjectMultiword.cpp755
-rw-r--r--source/Commands/CommandObjectPlatform.cpp3536
-rw-r--r--source/Commands/CommandObjectPlatform.h9
-rw-r--r--source/Commands/CommandObjectPlugin.cpp139
-rw-r--r--source/Commands/CommandObjectPlugin.h19
-rw-r--r--source/Commands/CommandObjectProcess.cpp2962
-rw-r--r--source/Commands/CommandObjectProcess.h7
-rw-r--r--source/Commands/CommandObjectQuit.cpp111
-rw-r--r--source/Commands/CommandObjectQuit.h17
-rw-r--r--source/Commands/CommandObjectRegister.cpp739
-rw-r--r--source/Commands/CommandObjectRegister.h21
-rw-r--r--source/Commands/CommandObjectSettings.cpp1898
-rw-r--r--source/Commands/CommandObjectSettings.h9
-rw-r--r--source/Commands/CommandObjectSource.cpp2565
-rw-r--r--source/Commands/CommandObjectSource.h13
-rw-r--r--source/Commands/CommandObjectSyntax.cpp157
-rw-r--r--source/Commands/CommandObjectSyntax.h12
-rw-r--r--source/Commands/CommandObjectTarget.cpp8942
-rw-r--r--source/Commands/CommandObjectTarget.h10
-rw-r--r--source/Commands/CommandObjectThread.cpp3649
-rw-r--r--source/Commands/CommandObjectThread.h8
-rw-r--r--source/Commands/CommandObjectType.cpp5806
-rw-r--r--source/Commands/CommandObjectType.h9
-rw-r--r--source/Commands/CommandObjectVersion.cpp39
-rw-r--r--source/Commands/CommandObjectVersion.h12
-rw-r--r--source/Commands/CommandObjectWatchpoint.cpp2122
-rw-r--r--source/Commands/CommandObjectWatchpoint.h13
-rw-r--r--source/Commands/CommandObjectWatchpointCommand.cpp1037
-rw-r--r--source/Commands/CommandObjectWatchpointCommand.h12
-rw-r--r--source/Core/Address.cpp1843
-rw-r--r--source/Core/AddressRange.cpp259
-rw-r--r--source/Core/AddressResolver.cpp39
-rw-r--r--source/Core/AddressResolverFileLine.cpp109
-rw-r--r--source/Core/AddressResolverName.cpp321
-rw-r--r--source/Core/ArchSpec.cpp2693
-rw-r--r--source/Core/Baton.cpp6
-rw-r--r--source/Core/Broadcaster.cpp828
-rw-r--r--source/Core/CMakeLists.txt3
-rw-r--r--source/Core/Communication.cpp685
-rw-r--r--source/Core/Connection.cpp18
-rw-r--r--source/Core/ConnectionMachPort.cpp331
-rw-r--r--source/Core/ConnectionSharedMemory.cpp171
-rw-r--r--source/Core/ConstString.cpp543
-rw-r--r--source/Core/CxaDemangle.cpp5014
-rw-r--r--source/Core/DataBufferHeap.cpp75
-rw-r--r--source/Core/DataBufferMemoryMap.cpp398
-rw-r--r--source/Core/DataEncoder.cpp348
-rw-r--r--source/Core/DataExtractor.cpp3448
-rw-r--r--source/Core/Debugger.cpp2792
-rw-r--r--source/Core/Disassembler.cpp2363
-rw-r--r--source/Core/DynamicLoader.cpp341
-rw-r--r--source/Core/EmulateInstruction.cpp1072
-rw-r--r--source/Core/Error.cpp450
-rw-r--r--source/Core/Event.cpp386
-rw-r--r--source/Core/FastDemangle.cpp4173
-rw-r--r--source/Core/FileLineResolver.cpp126
-rw-r--r--source/Core/FileSpecList.cpp162
-rw-r--r--source/Core/FormatEntity.cpp4389
-rw-r--r--source/Core/History.cpp6
-rw-r--r--source/Core/IOHandler.cpp9278
-rw-r--r--source/Core/Listener.cpp799
-rw-r--r--source/Core/Log.cpp757
-rw-r--r--source/Core/Logging.cpp491
-rw-r--r--source/Core/Mangled.cpp597
-rw-r--r--source/Core/Module.cpp3105
-rw-r--r--source/Core/ModuleChild.cpp38
-rw-r--r--source/Core/ModuleList.cpp1788
-rw-r--r--source/Core/Opcode.cpp225
-rw-r--r--source/Core/PluginManager.cpp4545
-rw-r--r--source/Core/RegisterValue.cpp1711
-rw-r--r--source/Core/RegularExpression.cpp261
-rw-r--r--source/Core/Scalar.cpp5140
-rw-r--r--source/Core/SearchFilter.cpp1262
-rw-r--r--source/Core/Section.cpp929
-rw-r--r--source/Core/SourceManager.cpp1180
-rw-r--r--source/Core/State.cpp176
-rw-r--r--source/Core/Stream.cpp1022
-rw-r--r--source/Core/StreamAsynchronousIO.cpp43
-rw-r--r--source/Core/StreamCallback.cpp59
-rw-r--r--source/Core/StreamFile.cpp66
-rw-r--r--source/Core/StreamGDBRemote.cpp64
-rw-r--r--source/Core/StreamString.cpp125
-rw-r--r--source/Core/StringList.cpp482
-rw-r--r--source/Core/StructuredData.cpp472
-rw-r--r--source/Core/Timer.cpp304
-rw-r--r--source/Core/UUID.cpp402
-rw-r--r--source/Core/UserID.cpp8
-rw-r--r--source/Core/UserSettingsController.cpp153
-rw-r--r--source/Core/VMRange.cpp135
-rw-r--r--source/Core/Value.cpp1383
-rw-r--r--source/Core/ValueObject.cpp7011
-rw-r--r--source/Core/ValueObjectCast.cpp138
-rw-r--r--source/Core/ValueObjectChild.cpp401
-rw-r--r--source/Core/ValueObjectConstResult.cpp498
-rw-r--r--source/Core/ValueObjectConstResultCast.cpp66
-rw-r--r--source/Core/ValueObjectConstResultChild.cpp96
-rw-r--r--source/Core/ValueObjectConstResultImpl.cpp290
-rw-r--r--source/Core/ValueObjectDynamicValue.cpp680
-rw-r--r--source/Core/ValueObjectList.cpp184
-rw-r--r--source/Core/ValueObjectMemory.cpp390
-rw-r--r--source/Core/ValueObjectRegister.cpp599
-rw-r--r--source/Core/ValueObjectSyntheticFilter.cpp662
-rw-r--r--source/Core/ValueObjectVariable.cpp674
-rw-r--r--source/DataFormatters/CXXFunctionPointer.cpp75
-rw-r--r--source/DataFormatters/DataVisualization.cpp310
-rw-r--r--source/DataFormatters/DumpValueObjectOptions.cpp351
-rw-r--r--source/DataFormatters/FormatCache.cpp339
-rw-r--r--source/DataFormatters/FormatClasses.cpp59
-rw-r--r--source/DataFormatters/FormatManager.cpp1955
-rw-r--r--source/DataFormatters/FormattersHelpers.cpp218
-rw-r--r--source/DataFormatters/LanguageCategory.cpp403
-rw-r--r--source/DataFormatters/StringPrinter.cpp1065
-rw-r--r--source/DataFormatters/TypeCategory.cpp1138
-rw-r--r--source/DataFormatters/TypeCategoryMap.cpp634
-rw-r--r--source/DataFormatters/TypeFormat.cpp368
-rw-r--r--source/DataFormatters/TypeSummary.cpp392
-rw-r--r--source/DataFormatters/TypeSynthetic.cpp356
-rw-r--r--source/DataFormatters/TypeValidator.cpp63
-rw-r--r--source/DataFormatters/ValueObjectPrinter.cpp1645
-rw-r--r--source/DataFormatters/VectorType.cpp551
-rw-r--r--source/Expression/CMakeLists.txt7
-rw-r--r--source/Expression/DWARFExpression.cpp6242
-rw-r--r--source/Expression/DiagnosticManager.cpp100
-rw-r--r--source/Expression/Expression.cpp27
-rw-r--r--source/Expression/ExpressionSourceCode.cpp605
-rw-r--r--source/Expression/ExpressionVariable.cpp122
-rw-r--r--source/Expression/FunctionCaller.cpp633
-rw-r--r--source/Expression/IRDynamicChecks.cpp933
-rw-r--r--source/Expression/IRExecutionUnit.cpp2054
-rw-r--r--source/Expression/IRInterpreter.cpp3190
-rw-r--r--source/Expression/IRMemoryMap.cpp1432
-rw-r--r--source/Expression/LLVMUserExpression.cpp571
-rw-r--r--source/Expression/Materializer.cpp2293
-rw-r--r--source/Expression/REPL.cpp1083
-rw-r--r--source/Expression/UserExpression.cpp632
-rw-r--r--source/Expression/UtilityFunction.cpp137
-rw-r--r--source/Host/CMakeLists.txt43
-rw-r--r--source/Host/android/HostInfoAndroid.cpp145
-rw-r--r--source/Host/android/LibcGlue.cpp14
-rw-r--r--source/Host/android/ProcessLauncherAndroid.cpp108
-rw-r--r--source/Host/common/Condition.cpp108
-rw-r--r--source/Host/common/Editline.cpp2394
-rw-r--r--source/Host/common/File.cpp1635
-rw-r--r--source/Host/common/FileCache.cpp183
-rw-r--r--source/Host/common/FileSpec.cpp2341
-rw-r--r--source/Host/common/FileSystem.cpp141
-rw-r--r--source/Host/common/GetOptInc.cpp717
-rw-r--r--source/Host/common/Host.cpp1555
-rw-r--r--source/Host/common/HostInfoBase.cpp668
-rw-r--r--source/Host/common/HostNativeThreadBase.cpp72
-rw-r--r--source/Host/common/HostProcess.cpp51
-rw-r--r--source/Host/common/HostThread.cpp65
-rw-r--r--source/Host/common/LockFileBase.cpp136
-rw-r--r--source/Host/common/MonitoringProcessLauncher.cpp118
-rw-r--r--source/Host/common/Mutex.cpp398
-rw-r--r--source/Host/common/NativeBreakpoint.cpp159
-rw-r--r--source/Host/common/NativeBreakpointList.cpp349
-rw-r--r--source/Host/common/NativeProcessProtocol.cpp667
-rw-r--r--source/Host/common/NativeRegisterContext.cpp661
-rw-r--r--source/Host/common/NativeRegisterContextRegisterInfo.cpp51
-rw-r--r--source/Host/common/NativeThreadProtocol.cpp79
-rw-r--r--source/Host/common/NativeWatchpointList.cpp24
-rw-r--r--source/Host/common/OptionParser.cpp136
-rw-r--r--source/Host/common/PipeBase.cpp15
-rw-r--r--source/Host/common/ProcessRunLock.cpp112
-rw-r--r--source/Host/common/Socket.cpp664
-rw-r--r--source/Host/common/SocketAddress.cpp448
-rw-r--r--source/Host/common/SoftwareBreakpoint.cpp558
-rw-r--r--source/Host/common/StringConvert.cpp169
-rw-r--r--source/Host/common/Symbols.cpp465
-rw-r--r--source/Host/common/TCPSocket.cpp397
-rw-r--r--source/Host/common/Terminal.cpp334
-rw-r--r--source/Host/common/ThisThread.cpp58
-rw-r--r--source/Host/common/ThreadLauncher.cpp100
-rw-r--r--source/Host/common/TimeValue.cpp222
-rw-r--r--source/Host/common/UDPSocket.cpp199
-rw-r--r--source/Host/common/XML.cpp944
-rw-r--r--source/Host/freebsd/Host.cpp424
-rw-r--r--source/Host/freebsd/HostInfoFreeBSD.cpp100
-rw-r--r--source/Host/freebsd/HostThreadFreeBSD.cpp77
-rw-r--r--source/Host/freebsd/ThisThread.cpp24
-rw-r--r--source/Host/linux/AbstractSocket.cpp15
-rw-r--r--source/Host/linux/Host.cpp612
-rw-r--r--source/Host/linux/HostInfoLinux.cpp403
-rw-r--r--source/Host/linux/HostThreadLinux.cpp43
-rw-r--r--source/Host/linux/LibcGlue.cpp27
-rw-r--r--source/Host/linux/ProcessLauncherLinux.cpp216
-rw-r--r--source/Host/linux/ThisThread.cpp14
-rw-r--r--source/Host/macosx/Host.mm2320
-rw-r--r--source/Host/macosx/HostInfoMacOSX.mm522
-rw-r--r--source/Host/macosx/HostThreadMacOSX.mm94
-rw-r--r--source/Host/macosx/Symbols.cpp987
-rw-r--r--source/Host/macosx/ThisThread.cpp16
-rw-r--r--source/Host/macosx/cfcpp/CFCBundle.cpp112
-rw-r--r--source/Host/macosx/cfcpp/CFCBundle.h38
-rw-r--r--source/Host/macosx/cfcpp/CFCData.cpp78
-rw-r--r--source/Host/macosx/cfcpp/CFCData.h30
-rw-r--r--source/Host/macosx/cfcpp/CFCMutableArray.cpp214
-rw-r--r--source/Host/macosx/cfcpp/CFCMutableArray.h47
-rw-r--r--source/Host/macosx/cfcpp/CFCMutableDictionary.cpp856
-rw-r--r--source/Host/macosx/cfcpp/CFCMutableDictionary.h108
-rw-r--r--source/Host/macosx/cfcpp/CFCMutableSet.cpp115
-rw-r--r--source/Host/macosx/cfcpp/CFCMutableSet.h58
-rw-r--r--source/Host/macosx/cfcpp/CFCReleaser.h218
-rw-r--r--source/Host/macosx/cfcpp/CFCString.cpp230
-rw-r--r--source/Host/macosx/cfcpp/CFCString.h40
-rw-r--r--source/Host/macosx/cfcpp/CoreFoundationCPP.h4
-rw-r--r--source/Host/netbsd/Host.cpp393
-rw-r--r--source/Host/netbsd/HostInfoNetBSD.cpp142
-rw-r--r--source/Host/netbsd/HostThreadNetBSD.cpp27
-rw-r--r--source/Host/netbsd/ThisThread.cpp14
-rw-r--r--source/Host/posix/ConnectionFileDescriptorPosix.cpp1381
-rw-r--r--source/Host/posix/DomainSocket.cpp141
-rw-r--r--source/Host/posix/FileSystem.cpp401
-rw-r--r--source/Host/posix/HostInfoPosix.cpp323
-rw-r--r--source/Host/posix/HostProcessPosix.cpp122
-rw-r--r--source/Host/posix/HostThreadPosix.cpp83
-rw-r--r--source/Host/posix/LockFilePosix.cpp69
-rw-r--r--source/Host/posix/MainLoopPosix.cpp295
-rw-r--r--source/Host/posix/PipePosix.cpp541
-rw-r--r--source/Host/posix/ProcessLauncherPosix.cpp21
-rw-r--r--source/Host/windows/Condition.cpp98
-rw-r--r--source/Host/windows/ConnectionGenericFileWindows.cpp555
-rw-r--r--source/Host/windows/EditLineWin.cpp620
-rw-r--r--source/Host/windows/FileSystem.cpp418
-rw-r--r--source/Host/windows/Host.cpp506
-rw-r--r--source/Host/windows/HostInfoWindows.cpp171
-rw-r--r--source/Host/windows/HostProcessWindows.cpp166
-rw-r--r--source/Host/windows/HostThreadWindows.cpp103
-rw-r--r--source/Host/windows/LockFileWindows.cpp91
-rw-r--r--source/Host/windows/Mutex.cpp109
-rw-r--r--source/Host/windows/PipeWindows.cpp477
-rw-r--r--source/Host/windows/ProcessLauncherWindows.cpp235
-rw-r--r--source/Host/windows/ProcessRunLock.cpp130
-rw-r--r--source/Host/windows/ThisThread.cpp57
-rw-r--r--source/Host/windows/Windows.cpp401
-rw-r--r--source/Initialization/SystemInitializer.cpp8
-rw-r--r--source/Initialization/SystemInitializerCommon.cpp132
-rw-r--r--source/Initialization/SystemLifetimeManager.cpp59
-rw-r--r--source/Interpreter/Args.cpp2911
-rw-r--r--source/Interpreter/CommandAlias.cpp467
-rw-r--r--source/Interpreter/CommandHistory.cpp179
-rw-r--r--source/Interpreter/CommandInterpreter.cpp5956
-rw-r--r--source/Interpreter/CommandObject.cpp1824
-rw-r--r--source/Interpreter/CommandObjectRegexCommand.cpp191
-rw-r--r--source/Interpreter/CommandObjectScript.cpp96
-rw-r--r--source/Interpreter/CommandObjectScript.h12
-rw-r--r--source/Interpreter/CommandOptionValidators.cpp32
-rw-r--r--source/Interpreter/CommandReturnObject.cpp307
-rw-r--r--source/Interpreter/OptionGroupArchitecture.cpp84
-rw-r--r--source/Interpreter/OptionGroupBoolean.cpp78
-rw-r--r--source/Interpreter/OptionGroupFile.cpp116
-rw-r--r--source/Interpreter/OptionGroupFormat.cpp440
-rw-r--r--source/Interpreter/OptionGroupOutputFile.cpp85
-rw-r--r--source/Interpreter/OptionGroupPlatform.cpp267
-rw-r--r--source/Interpreter/OptionGroupString.cpp60
-rw-r--r--source/Interpreter/OptionGroupUInt64.cpp60
-rw-r--r--source/Interpreter/OptionGroupUUID.cpp76
-rw-r--r--source/Interpreter/OptionGroupValueObjectDisplay.cpp365
-rw-r--r--source/Interpreter/OptionGroupVariable.cpp208
-rw-r--r--source/Interpreter/OptionGroupWatchpoint.cpp161
-rw-r--r--source/Interpreter/OptionValue.cpp1222
-rw-r--r--source/Interpreter/OptionValueArch.cpp128
-rw-r--r--source/Interpreter/OptionValueArgs.cpp24
-rw-r--r--source/Interpreter/OptionValueArray.cpp573
-rw-r--r--source/Interpreter/OptionValueBoolean.cpp167
-rw-r--r--source/Interpreter/OptionValueChar.cpp86
-rw-r--r--source/Interpreter/OptionValueDictionary.cpp640
-rw-r--r--source/Interpreter/OptionValueEnumeration.cpp219
-rw-r--r--source/Interpreter/OptionValueFileSpec.cpp232
-rw-r--r--source/Interpreter/OptionValueFileSpecLIst.cpp292
-rw-r--r--source/Interpreter/OptionValueFormat.cpp87
-rw-r--r--source/Interpreter/OptionValueFormatEntity.cpp183
-rw-r--r--source/Interpreter/OptionValueLanguage.cpp113
-rw-r--r--source/Interpreter/OptionValuePathMappings.cpp379
-rw-r--r--source/Interpreter/OptionValueProperties.cpp1260
-rw-r--r--source/Interpreter/OptionValueRegex.cpp100
-rw-r--r--source/Interpreter/OptionValueSInt64.cpp116
-rw-r--r--source/Interpreter/OptionValueString.cpp265
-rw-r--r--source/Interpreter/OptionValueUInt64.cpp114
-rw-r--r--source/Interpreter/OptionValueUUID.cpp162
-rw-r--r--source/Interpreter/Options.cpp1779
-rw-r--r--source/Interpreter/Property.cpp517
-rw-r--r--source/Interpreter/ScriptInterpreter.cpp133
-rw-r--r--source/Interpreter/embedded_interpreter.py44
-rw-r--r--source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp2764
-rw-r--r--source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h176
-rw-r--r--source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp3270
-rw-r--r--source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h185
-rw-r--r--source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp1573
-rw-r--r--source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h188
-rw-r--r--source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp2995
-rw-r--r--source/Plugins/ABI/SysV-arm/ABISysV_arm.h176
-rw-r--r--source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp3222
-rw-r--r--source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h183
-rw-r--r--source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp1630
-rw-r--r--source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h197
-rw-r--r--source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp1432
-rw-r--r--source/Plugins/ABI/SysV-i386/ABISysV_i386.h204
-rw-r--r--source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp1523
-rw-r--r--source/Plugins/ABI/SysV-mips/ABISysV_mips.h136
-rw-r--r--source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp1877
-rw-r--r--source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h199
-rw-r--r--source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp1631
-rw-r--r--source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h190
-rw-r--r--source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp1640
-rw-r--r--source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h192
-rw-r--r--source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp1172
-rw-r--r--source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h131
-rw-r--r--source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp2798
-rw-r--r--source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h192
-rw-r--r--source/Plugins/CMakeLists.txt1
-rw-r--r--source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp2104
-rw-r--r--source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h231
-rw-r--r--source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp2612
-rw-r--r--source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h550
-rw-r--r--source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp1035
-rw-r--r--source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h229
-rw-r--r--source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp572
-rw-r--r--source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.h412
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt1
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp1914
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h430
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp522
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h117
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp2035
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h303
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp142
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h129
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp979
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h399
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp1145
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h248
-rw-r--r--source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp230
-rw-r--r--source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h76
-rw-r--r--source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp102
-rw-r--r--source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h35
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTDumper.cpp162
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTDumper.h33
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp795
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h357
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp277
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h246
-rw-r--r--source/Plugins/ExpressionParser/Clang/CMakeLists.txt7
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp3145
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangASTSource.h934
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h58
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp3649
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h1225
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h77
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp1638
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h254
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp81
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h359
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp319
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h195
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp1217
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h197
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp106
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h127
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp1093
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangUserExpression.h302
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp209
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h152
-rw-r--r--source/Plugins/ExpressionParser/Clang/IRForTarget.cpp3298
-rw-r--r--source/Plugins/ExpressionParser/Clang/IRForTarget.h1221
-rw-r--r--source/Plugins/ExpressionParser/Go/GoAST.h4405
-rw-r--r--source/Plugins/ExpressionParser/Go/GoLexer.cpp650
-rw-r--r--source/Plugins/ExpressionParser/Go/GoLexer.h322
-rw-r--r--source/Plugins/ExpressionParser/Go/GoParser.cpp1717
-rw-r--r--source/Plugins/ExpressionParser/Go/GoParser.h272
-rw-r--r--source/Plugins/ExpressionParser/Go/GoUserExpression.cpp1151
-rw-r--r--source/Plugins/ExpressionParser/Go/GoUserExpression.h108
-rw-r--r--source/Plugins/ExpressionParser/Go/gen_go_ast.py150
-rw-r--r--source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp22758
-rw-r--r--source/Plugins/Instruction/ARM/EmulateInstructionARM.h1695
-rw-r--r--source/Plugins/Instruction/ARM/EmulationStateARM.cpp669
-rw-r--r--source/Plugins/Instruction/ARM/EmulationStateARM.h130
-rw-r--r--source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp1896
-rw-r--r--source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h418
-rw-r--r--source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp4990
-rw-r--r--source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h342
-rw-r--r--source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp3811
-rw-r--r--source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h284
-rw-r--r--source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp494
-rw-r--r--source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h117
-rw-r--r--source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp1395
-rw-r--r--source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h152
-rw-r--r--source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp753
-rw-r--r--source/Plugins/JITLoader/GDB/JITLoaderGDB.h107
-rw-r--r--source/Plugins/Language/CMakeLists.txt1
-rw-r--r--source/Plugins/Language/CPlusPlus/BlockPointer.cpp316
-rw-r--r--source/Plugins/Language/CPlusPlus/BlockPointer.h13
-rw-r--r--source/Plugins/Language/CPlusPlus/CMakeLists.txt2
-rw-r--r--source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp1755
-rw-r--r--source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h282
-rw-r--r--source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp353
-rw-r--r--source/Plugins/Language/CPlusPlus/CxxStringTypes.h47
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxx.cpp1083
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxx.h250
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp154
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxAtomic.h20
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp179
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxList.cpp651
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxMap.cpp772
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp258
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxVector.cpp206
-rw-r--r--source/Plugins/Language/CPlusPlus/LibStdcpp.cpp695
-rw-r--r--source/Plugins/Language/CPlusPlus/LibStdcpp.h48
-rw-r--r--source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp109
-rw-r--r--source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp151
-rw-r--r--source/Plugins/Language/Go/GoFormatterFunctions.cpp247
-rw-r--r--source/Plugins/Language/Go/GoFormatterFunctions.h12
-rw-r--r--source/Plugins/Language/Go/GoLanguage.cpp164
-rw-r--r--source/Plugins/Language/Go/GoLanguage.h51
-rw-r--r--source/Plugins/Language/Java/JavaFormatterFunctions.cpp281
-rw-r--r--source/Plugins/Language/Java/JavaFormatterFunctions.h19
-rw-r--r--source/Plugins/Language/Java/JavaLanguage.cpp114
-rw-r--r--source/Plugins/Language/Java/JavaLanguage.h38
-rw-r--r--source/Plugins/Language/OCaml/CMakeLists.txt4
-rw-r--r--source/Plugins/Language/OCaml/OCamlLanguage.cpp63
-rw-r--r--source/Plugins/Language/OCaml/OCamlLanguage.h51
-rw-r--r--source/Plugins/Language/ObjC/CF.cpp539
-rw-r--r--source/Plugins/Language/ObjC/CF.h27
-rw-r--r--source/Plugins/Language/ObjC/Cocoa.cpp1688
-rw-r--r--source/Plugins/Language/ObjC/Cocoa.h176
-rw-r--r--source/Plugins/Language/ObjC/CoreMedia.cpp142
-rw-r--r--source/Plugins/Language/ObjC/CoreMedia.h14
-rw-r--r--source/Plugins/Language/ObjC/NSArray.cpp1295
-rw-r--r--source/Plugins/Language/ObjC/NSDictionary.cpp1337
-rw-r--r--source/Plugins/Language/ObjC/NSDictionary.h97
-rw-r--r--source/Plugins/Language/ObjC/NSError.cpp347
-rw-r--r--source/Plugins/Language/ObjC/NSException.cpp341
-rw-r--r--source/Plugins/Language/ObjC/NSIndexPath.cpp610
-rw-r--r--source/Plugins/Language/ObjC/NSSet.cpp1086
-rw-r--r--source/Plugins/Language/ObjC/NSSet.h38
-rw-r--r--source/Plugins/Language/ObjC/NSString.cpp716
-rw-r--r--source/Plugins/Language/ObjC/NSString.h44
-rw-r--r--source/Plugins/Language/ObjC/ObjCLanguage.cpp1751
-rw-r--r--source/Plugins/Language/ObjC/ObjCLanguage.h312
-rw-r--r--source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp56
-rw-r--r--source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h68
-rw-r--r--source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp975
-rw-r--r--source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h192
-rw-r--r--source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp310
-rw-r--r--source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.h133
-rw-r--r--source/Plugins/LanguageRuntime/Java/JavaLanguageRuntime.cpp237
-rw-r--r--source/Plugins/LanguageRuntime/Java/JavaLanguageRuntime.h80
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp1010
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h665
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp1175
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h46
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp826
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h217
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp711
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h308
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp3872
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h629
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp1648
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h295
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp659
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h112
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp334
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h118
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt11
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp200
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h57
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp8059
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h705
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp162
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.h18
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp297
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.h23
-rw-r--r--source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp276
-rw-r--r--source/Plugins/MemoryHistory/asan/MemoryHistoryASan.h57
-rw-r--r--source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp945
-rw-r--r--source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h355
-rw-r--r--source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp421
-rw-r--r--source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h141
-rw-r--r--source/Plugins/ObjectFile/ELF/ELFHeader.cpp607
-rw-r--r--source/Plugins/ObjectFile/ELF/ELFHeader.h645
-rw-r--r--source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp5918
-rw-r--r--source/Plugins/ObjectFile/ELF/ObjectFileELF.h766
-rw-r--r--source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp429
-rw-r--r--source/Plugins/ObjectFile/JIT/ObjectFileJIT.h201
-rw-r--r--source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp11217
-rw-r--r--source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h396
-rw-r--r--source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp1748
-rw-r--r--source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h540
-rw-r--r--source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp63
-rw-r--r--source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h9
-rw-r--r--source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp825
-rw-r--r--source/Plugins/OperatingSystem/Go/OperatingSystemGo.h83
-rw-r--r--source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp678
-rw-r--r--source/Plugins/OperatingSystem/Python/OperatingSystemPython.h139
-rw-r--r--source/Plugins/Platform/Android/AdbClient.cpp998
-rw-r--r--source/Plugins/Platform/Android/AdbClient.h170
-rw-r--r--source/Plugins/Platform/Android/PlatformAndroid.cpp604
-rw-r--r--source/Plugins/Platform/Android/PlatformAndroid.h152
-rw-r--r--source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp371
-rw-r--r--source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h50
-rw-r--r--source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp1031
-rw-r--r--source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h192
-rw-r--r--source/Plugins/Platform/Kalimba/PlatformKalimba.cpp433
-rw-r--r--source/Plugins/Platform/Kalimba/PlatformKalimba.h99
-rw-r--r--source/Plugins/Platform/Linux/PlatformLinux.cpp1148
-rw-r--r--source/Plugins/Platform/Linux/PlatformLinux.h158
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp376
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h95
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp659
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h168
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp662
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h167
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformDarwin.cpp3237
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformDarwin.h256
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp1567
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h334
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp544
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformMacOSX.h147
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp1652
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h248
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp1758
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h250
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp1562
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h256
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp729
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h163
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h474
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm1163
-rw-r--r--source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp948
-rw-r--r--source/Plugins/Platform/NetBSD/PlatformNetBSD.h187
-rw-r--r--source/Plugins/Platform/POSIX/PlatformPOSIX.cpp1578
-rw-r--r--source/Plugins/Platform/POSIX/PlatformPOSIX.h349
-rw-r--r--source/Plugins/Platform/Windows/PlatformWindows.cpp1036
-rw-r--r--source/Plugins/Platform/Windows/PlatformWindows.h177
-rw-r--r--source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp1619
-rw-r--r--source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h403
-rw-r--r--source/Plugins/Process/CMakeLists.txt3
-rw-r--r--source/Plugins/Process/Darwin/CFBundle.cpp79
-rw-r--r--source/Plugins/Process/Darwin/CFBundle.h38
-rw-r--r--source/Plugins/Process/Darwin/CFString.cpp163
-rw-r--r--source/Plugins/Process/Darwin/CFString.h43
-rw-r--r--source/Plugins/Process/Darwin/CFUtils.h78
-rw-r--r--source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp653
-rw-r--r--source/Plugins/Process/Darwin/DarwinProcessLauncher.h48
-rw-r--r--source/Plugins/Process/Darwin/LaunchFlavor.h33
-rw-r--r--source/Plugins/Process/Darwin/MachException.cpp543
-rw-r--r--source/Plugins/Process/Darwin/MachException.h140
-rw-r--r--source/Plugins/Process/Darwin/NativeProcessDarwin.cpp1576
-rw-r--r--source/Plugins/Process/Darwin/NativeProcessDarwin.h384
-rw-r--r--source/Plugins/Process/Darwin/NativeThreadDarwin.cpp284
-rw-r--r--source/Plugins/Process/Darwin/NativeThreadDarwin.h178
-rw-r--r--source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp698
-rw-r--r--source/Plugins/Process/Darwin/NativeThreadListDarwin.h139
-rw-r--r--source/Plugins/Process/FreeBSD/FreeBSDThread.cpp1089
-rw-r--r--source/Plugins/Process/FreeBSD/FreeBSDThread.h163
-rw-r--r--source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp69
-rw-r--r--source/Plugins/Process/FreeBSD/POSIXStopInfo.h68
-rw-r--r--source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp1476
-rw-r--r--source/Plugins/Process/FreeBSD/ProcessFreeBSD.h286
-rw-r--r--source/Plugins/Process/FreeBSD/ProcessMonitor.cpp2144
-rw-r--r--source/Plugins/Process/FreeBSD/ProcessMonitor.h460
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h73
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp428
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.h89
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp423
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h90
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp413
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.h90
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp452
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.h102
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp1037
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h93
-rw-r--r--source/Plugins/Process/Linux/NativeProcessLinux.cpp4619
-rw-r--r--source/Plugins/Process/Linux/NativeProcessLinux.h297
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp315
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux.h105
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp1626
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h219
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp1635
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h220
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp2144
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h166
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp1050
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h131
-rwxr-xr-xsource/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp2096
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h191
-rw-r--r--source/Plugins/Process/Linux/NativeThreadLinux.cpp758
-rw-r--r--source/Plugins/Process/Linux/NativeThreadLinux.h145
-rw-r--r--source/Plugins/Process/Linux/ProcFileReader.cpp139
-rw-r--r--source/Plugins/Process/Linux/ProcFileReader.h24
-rw-r--r--source/Plugins/Process/Linux/Procfs.h14
-rw-r--r--source/Plugins/Process/Linux/SingleStepCheck.cpp249
-rw-r--r--source/Plugins/Process/Linux/SingleStepCheck.h35
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp2403
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h547
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp1834
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h417
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.cpp302
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.h55
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.cpp224
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.h53
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.cpp227
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.h56
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp170
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.h48
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.cpp171
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.h49
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp268
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h101
-rw-r--r--source/Plugins/Process/POSIX/CrashReason.cpp577
-rw-r--r--source/Plugins/Process/POSIX/CrashReason.h74
-rw-r--r--source/Plugins/Process/POSIX/ProcessMessage.cpp103
-rw-r--r--source/Plugins/Process/POSIX/ProcessMessage.h299
-rw-r--r--source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp311
-rw-r--r--source/Plugins/Process/POSIX/ProcessPOSIXLog.h169
-rw-r--r--source/Plugins/Process/Utility/ARMDefines.h255
-rw-r--r--source/Plugins/Process/Utility/ARMUtils.h567
-rw-r--r--source/Plugins/Process/Utility/CMakeLists.txt3
-rw-r--r--source/Plugins/Process/Utility/DynamicRegisterInfo.cpp1379
-rw-r--r--source/Plugins/Process/Utility/DynamicRegisterInfo.h115
-rw-r--r--source/Plugins/Process/Utility/FreeBSDSignals.cpp146
-rw-r--r--source/Plugins/Process/Utility/FreeBSDSignals.h8
-rw-r--r--source/Plugins/Process/Utility/GDBRemoteSignals.cpp16
-rw-r--r--source/Plugins/Process/Utility/GDBRemoteSignals.h10
-rw-r--r--source/Plugins/Process/Utility/HistoryThread.cpp106
-rw-r--r--source/Plugins/Process/Utility/HistoryThread.h158
-rw-r--r--source/Plugins/Process/Utility/HistoryUnwind.cpp86
-rw-r--r--source/Plugins/Process/Utility/HistoryUnwind.h31
-rw-r--r--source/Plugins/Process/Utility/InferiorCallPOSIX.cpp386
-rw-r--r--source/Plugins/Process/Utility/InferiorCallPOSIX.h8
-rw-r--r--source/Plugins/Process/Utility/InstructionUtils.h138
-rw-r--r--source/Plugins/Process/Utility/LinuxSignals.cpp153
-rw-r--r--source/Plugins/Process/Utility/LinuxSignals.h8
-rw-r--r--source/Plugins/Process/Utility/MipsLinuxSignals.cpp156
-rw-r--r--source/Plugins/Process/Utility/MipsLinuxSignals.h11
-rw-r--r--source/Plugins/Process/Utility/NetBSDSignals.cpp22
-rw-r--r--source/Plugins/Process/Utility/NetBSDSignals.h8
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp2654
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_arm.h447
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp1673
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h428
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp1582
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_i386.h393
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp1756
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h434
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDummy.cpp148
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDummy.h76
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp100
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h98
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp86
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h78
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp102
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.h15
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp120
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h16
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp406
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h55
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp222
-rw-r--r--source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h20
-rw-r--r--source/Plugins/Process/Utility/RegisterContextHistory.cpp151
-rw-r--r--source/Plugins/Process/Utility/RegisterContextHistory.h80
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLLDB.cpp3704
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLLDB.h437
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp100
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_arm.h99
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp89
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_arm64.h80
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp200
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_i386.h24
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp62
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_mips.h23
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp139
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_mips64.h29
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp95
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_s390x.h29
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp304
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h31
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp252
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h59
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMach_arm.cpp72
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMach_arm.h49
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMach_i386.cpp57
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMach_i386.h45
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp60
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMach_x86_64.h48
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMemory.cpp204
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMemory.h107
-rw-r--r--source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp570
-rw-r--r--source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h20
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp385
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h158
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp376
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h157
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp265
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.h83
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp368
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h330
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp291
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.h111
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp1032
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h323
-rw-r--r--source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp390
-rw-r--r--source/Plugins/Process/Utility/RegisterContextThreadMemory.h163
-rw-r--r--source/Plugins/Process/Utility/RegisterContext_mips.h702
-rw-r--r--source/Plugins/Process/Utility/RegisterContext_powerpc.h219
-rw-r--r--source/Plugins/Process/Utility/RegisterContext_s390x.h148
-rw-r--r--source/Plugins/Process/Utility/RegisterContext_x86.h553
-rw-r--r--source/Plugins/Process/Utility/RegisterInfoInterface.h99
-rw-r--r--source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp99
-rw-r--r--source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h70
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_arm.h2027
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_arm64.h956
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_i386.h385
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_mips.h59
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_mips64.h198
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_powerpc.h329
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_s390x.h93
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_x86_64.h728
-rw-r--r--source/Plugins/Process/Utility/StopInfoMachException.cpp1019
-rw-r--r--source/Plugins/Process/Utility/StopInfoMachException.h71
-rw-r--r--source/Plugins/Process/Utility/ThreadMemory.cpp171
-rw-r--r--source/Plugins/Process/Utility/ThreadMemory.h201
-rw-r--r--source/Plugins/Process/Utility/UnwindLLDB.cpp879
-rw-r--r--source/Plugins/Process/Utility/UnwindLLDB.h248
-rw-r--r--source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp443
-rw-r--r--source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h68
-rw-r--r--source/Plugins/Process/Utility/lldb-arm-register-enums.h363
-rw-r--r--source/Plugins/Process/Utility/lldb-arm64-register-enums.h397
-rw-r--r--source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h106
-rw-r--r--source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h522
-rw-r--r--source/Plugins/Process/Utility/lldb-s390x-register-enums.h139
-rw-r--r--source/Plugins/Process/Utility/lldb-x86-register-enums.h558
-rw-r--r--source/Plugins/Process/Windows/Common/CMakeLists.txt4
-rw-r--r--source/Plugins/Process/Windows/Common/DebuggerThread.cpp549
-rw-r--r--source/Plugins/Process/Windows/Common/DebuggerThread.h106
-rw-r--r--source/Plugins/Process/Windows/Common/ExceptionRecord.h105
-rw-r--r--source/Plugins/Process/Windows/Common/ForwardDecl.h (renamed from source/Plugins/Process/Windows/Live/ForwardDecl.h)19
-rw-r--r--source/Plugins/Process/Windows/Common/IDebugDelegate.h (renamed from source/Plugins/Process/Windows/Live/IDebugDelegate.h)30
-rw-r--r--source/Plugins/Process/Windows/Common/LocalDebugDelegate.cpp73
-rw-r--r--source/Plugins/Process/Windows/Common/LocalDebugDelegate.h (renamed from source/Plugins/Process/Windows/Live/LocalDebugDelegate.h)51
-rw-r--r--source/Plugins/Process/Windows/Common/NtStructures.h23
-rw-r--r--source/Plugins/Process/Windows/Common/ProcessWindows.cpp1067
-rw-r--r--source/Plugins/Process/Windows/Common/ProcessWindows.h117
-rw-r--r--source/Plugins/Process/Windows/Common/ProcessWindowsLog.cpp260
-rw-r--r--source/Plugins/Process/Windows/Common/ProcessWindowsLog.h151
-rw-r--r--source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp168
-rw-r--r--source/Plugins/Process/Windows/Common/RegisterContextWindows.h64
-rw-r--r--source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp143
-rw-r--r--source/Plugins/Process/Windows/Common/TargetThreadWindows.h53
-rw-r--r--source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp437
-rw-r--r--source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h40
-rw-r--r--source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp361
-rw-r--r--source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h45
-rw-r--r--source/Plugins/Process/Windows/Live/CMakeLists.txt24
-rw-r--r--source/Plugins/Process/Windows/Live/DebuggerThread.cpp549
-rw-r--r--source/Plugins/Process/Windows/Live/DebuggerThread.h100
-rw-r--r--source/Plugins/Process/Windows/Live/LocalDebugDelegate.cpp91
-rw-r--r--source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp1069
-rw-r--r--source/Plugins/Process/Windows/Live/ProcessWindowsLive.h125
-rw-r--r--source/Plugins/Process/Windows/Live/TargetThreadWindowsLive.cpp147
-rw-r--r--source/Plugins/Process/Windows/Live/TargetThreadWindowsLive.h55
-rw-r--r--source/Plugins/Process/Windows/Live/x64/RegisterContextWindowsLive_x64.cpp171
-rw-r--r--source/Plugins/Process/Windows/Live/x64/RegisterContextWindowsLive_x64.h40
-rw-r--r--source/Plugins/Process/Windows/Live/x86/RegisterContextWindowsLive_x86.cpp100
-rw-r--r--source/Plugins/Process/Windows/Live/x86/RegisterContextWindowsLive_x86.h36
-rw-r--r--source/Plugins/Process/Windows/MiniDump/CMakeLists.txt21
-rw-r--r--source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp710
-rw-r--r--source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h104
-rw-r--r--source/Plugins/Process/Windows/MiniDump/ThreadWinMiniDump.cpp104
-rw-r--r--source/Plugins/Process/Windows/MiniDump/ThreadWinMiniDump.h49
-rw-r--r--source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindowsMiniDump_x64.cpp47
-rw-r--r--source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindowsMiniDump_x64.h36
-rw-r--r--source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.cpp47
-rw-r--r--source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.h36
-rw-r--r--source/Plugins/Process/elf-core/ProcessElfCore.cpp1077
-rw-r--r--source/Plugins/Process/elf-core/ProcessElfCore.h229
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp102
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h55
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp102
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h55
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp102
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h55
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp169
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h70
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp138
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h54
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp127
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h51
-rw-r--r--source/Plugins/Process/elf-core/ThreadElfCore.cpp496
-rw-r--r--source/Plugins/Process/elf-core/ThreadElfCore.h296
-rw-r--r--source/Plugins/Process/gdb-remote/CMakeLists.txt1
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp376
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h144
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp2469
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h538
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp7509
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h1188
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp154
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h61
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp2074
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h205
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp5426
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h364
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp896
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h128
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp1926
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h181
-rw-r--r--source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp9096
-rw-r--r--source/Plugins/Process/gdb-remote/ProcessGDBRemote.h711
-rw-r--r--source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp342
-rw-r--r--source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h58
-rw-r--r--source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp569
-rw-r--r--source/Plugins/Process/gdb-remote/ThreadGDBRemote.h154
-rw-r--r--source/Plugins/Process/mach-core/ProcessMachCore.cpp1009
-rw-r--r--source/Plugins/Process/mach-core/ProcessMachCore.h258
-rw-r--r--source/Plugins/Process/mach-core/ThreadMachCore.cpp139
-rw-r--r--source/Plugins/Process/mach-core/ThreadMachCore.h87
-rw-r--r--source/Plugins/Process/minidump/CMakeLists.txt10
-rw-r--r--source/Plugins/Process/minidump/MinidumpParser.cpp458
-rw-r--r--source/Plugins/Process/minidump/MinidumpParser.h102
-rw-r--r--source/Plugins/Process/minidump/MinidumpTypes.cpp235
-rw-r--r--source/Plugins/Process/minidump/MinidumpTypes.h470
-rw-r--r--source/Plugins/Process/minidump/NtStructures.h37
-rw-r--r--source/Plugins/Process/minidump/ProcessMinidump.cpp301
-rw-r--r--source/Plugins/Process/minidump/ProcessMinidump.h105
-rw-r--r--source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.cpp99
-rw-r--r--source/Plugins/Process/minidump/RegisterContextMinidump_x86_32.h138
-rw-r--r--source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.cpp113
-rw-r--r--source/Plugins/Process/minidump/RegisterContextMinidump_x86_64.h183
-rw-r--r--source/Plugins/Process/minidump/ThreadMinidump.cpp114
-rw-r--r--source/Plugins/Process/minidump/ThreadMinidump.h52
-rw-r--r--source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp80
-rw-r--r--source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h55
-rw-r--r--source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp1661
-rw-r--r--source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h721
-rw-r--r--source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp268
-rw-r--r--source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h55
-rw-r--r--source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp5618
-rw-r--r--source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h1058
-rw-r--r--source/Plugins/ScriptInterpreter/Python/lldb-python.h14
-rw-r--r--source/Plugins/StructuredData/CMakeLists.txt2
-rw-r--r--source/Plugins/StructuredData/DarwinLog/CMakeLists.txt5
-rw-r--r--source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp2018
-rw-r--r--source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h138
-rw-r--r--source/Plugins/SymbolFile/DWARF/CMakeLists.txt1
-rw-r--r--source/Plugins/SymbolFile/DWARF/DIERef.cpp113
-rw-r--r--source/Plugins/SymbolFile/DWARF/DIERef.h60
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParser.h45
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp7609
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h246
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp1391
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.h88
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp932
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.h93
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp209
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h60
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp139
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h101
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp108
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAttribute.h106
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp2003
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h440
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp784
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDIE.h350
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp34
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h36
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp19
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h31
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp209
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h84
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp472
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h100
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp204
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h108
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp942
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h116
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp3300
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h629
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp1903
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h398
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp43
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h17
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp179
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h47
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp187
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h60
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp436
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h32
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp234
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h123
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp222
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h38
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp152
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h143
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp940
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDefines.h126
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp1067
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFFormValue.h154
-rw-r--r--source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp1252
-rw-r--r--source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h350
-rw-r--r--source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp350
-rw-r--r--source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h89
-rw-r--r--source/Plugins/SymbolFile/DWARF/NameToDIE.cpp102
-rw-r--r--source/Plugins/SymbolFile/DWARF/NameToDIE.h51
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp7823
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h890
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp2577
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h713
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp149
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h74
-rw-r--r--source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp118
-rw-r--r--source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h182
-rw-r--r--source/Plugins/SymbolFile/PDB/CMakeLists.txt2
-rw-r--r--source/Plugins/SymbolFile/PDB/PDBASTParser.cpp367
-rw-r--r--source/Plugins/SymbolFile/PDB/PDBASTParser.h30
-rw-r--r--source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp1167
-rw-r--r--source/Plugins/SymbolFile/PDB/SymbolFilePDB.h244
-rw-r--r--source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp445
-rw-r--r--source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h142
-rw-r--r--source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp249
-rw-r--r--source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h52
-rw-r--r--source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp407
-rw-r--r--source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h55
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp519
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h134
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp523
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h141
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp508
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h126
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp523
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h135
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp1681
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h506
-rw-r--r--source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp1181
-rw-r--r--source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h292
-rw-r--r--source/Plugins/UnwindAssembly/x86/CMakeLists.txt1
-rw-r--r--source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp1667
-rw-r--r--source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h101
-rw-r--r--source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp1203
-rw-r--r--source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h181
-rw-r--r--source/Symbol/ArmUnwindInfo.cpp696
-rw-r--r--source/Symbol/Block.cpp962
-rw-r--r--source/Symbol/CMakeLists.txt1
-rw-r--r--source/Symbol/ClangASTContext.cpp18278
-rw-r--r--source/Symbol/ClangASTImporter.cpp1952
-rw-r--r--source/Symbol/ClangExternalASTSourceCallbacks.cpp238
-rw-r--r--source/Symbol/ClangExternalASTSourceCommon.cpp131
-rw-r--r--source/Symbol/ClangUtil.cpp50
-rw-r--r--source/Symbol/CompactUnwindInfo.cpp2944
-rw-r--r--source/Symbol/CompileUnit.cpp712
-rw-r--r--source/Symbol/CompilerDecl.cpp60
-rw-r--r--source/Symbol/CompilerDeclContext.cpp94
-rw-r--r--source/Symbol/CompilerType.cpp1779
-rw-r--r--source/Symbol/DWARFCallFrameInfo.cpp1642
-rw-r--r--source/Symbol/DebugMacros.cpp55
-rw-r--r--source/Symbol/Declaration.cpp138
-rw-r--r--source/Symbol/FuncUnwinders.cpp665
-rw-r--r--source/Symbol/Function.cpp1012
-rw-r--r--source/Symbol/GoASTContext.cpp2488
-rw-r--r--source/Symbol/JavaASTContext.cpp2290
-rw-r--r--source/Symbol/LineEntry.cpp445
-rw-r--r--source/Symbol/LineTable.cpp1000
-rw-r--r--source/Symbol/OCamlASTContext.cpp669
-rw-r--r--source/Symbol/ObjectFile.cpp1143
-rw-r--r--source/Symbol/Symbol.cpp1111
-rw-r--r--source/Symbol/SymbolContext.cpp2400
-rw-r--r--source/Symbol/SymbolFile.cpp218
-rw-r--r--source/Symbol/SymbolVendor.cpp895
-rw-r--r--source/Symbol/Symtab.cpp2059
-rw-r--r--source/Symbol/Type.cpp2151
-rw-r--r--source/Symbol/TypeList.cpp326
-rw-r--r--source/Symbol/TypeMap.cpp382
-rw-r--r--source/Symbol/TypeSystem.cpp365
-rw-r--r--source/Symbol/UnwindPlan.cpp967
-rw-r--r--source/Symbol/UnwindTable.cpp269
-rw-r--r--source/Symbol/Variable.cpp1529
-rw-r--r--source/Symbol/VariableList.cpp346
-rw-r--r--source/Symbol/VerifyDecl.cpp5
-rw-r--r--source/Target/ABI.cpp340
-rw-r--r--source/Target/CMakeLists.txt2
-rw-r--r--source/Target/CPPLanguageRuntime.cpp32
-rw-r--r--source/Target/ExecutionContext.cpp1228
-rw-r--r--source/Target/FileAction.cpp147
-rw-r--r--source/Target/InstrumentationRuntime.cpp86
-rw-r--r--source/Target/InstrumentationRuntimeStopInfo.cpp29
-rw-r--r--source/Target/JITLoader.cpp29
-rw-r--r--source/Target/JITLoaderList.cpp76
-rw-r--r--source/Target/Language.cpp682
-rw-r--r--source/Target/LanguageRuntime.cpp534
-rw-r--r--source/Target/Memory.cpp865
-rw-r--r--source/Target/MemoryHistory.cpp26
-rw-r--r--source/Target/ObjCLanguageRuntime.cpp622
-rw-r--r--source/Target/OperatingSystem.cpp65
-rw-r--r--source/Target/PathMappingList.cpp493
-rw-r--r--source/Target/Platform.cpp3318
-rw-r--r--source/Target/Process.cpp11473
-rw-r--r--source/Target/ProcessInfo.cpp194
-rw-r--r--source/Target/ProcessLaunchInfo.cpp788
-rw-r--r--source/Target/Queue.cpp137
-rw-r--r--source/Target/QueueItem.cpp175
-rw-r--r--source/Target/QueueList.cpp106
-rw-r--r--source/Target/RegisterContext.cpp818
-rw-r--r--source/Target/SectionLoadHistory.cpp257
-rw-r--r--source/Target/SectionLoadList.cpp431
-rw-r--r--source/Target/StackFrame.cpp3147
-rw-r--r--source/Target/StackFrameList.cpp1522
-rw-r--r--source/Target/StackID.cpp144
-rw-r--r--source/Target/StopInfo.cpp2044
-rw-r--r--source/Target/StructuredDataPlugin.cpp68
-rw-r--r--source/Target/SystemRuntime.cpp66
-rw-r--r--source/Target/Target.cpp7343
-rw-r--r--source/Target/TargetList.cpp1154
-rw-r--r--source/Target/Thread.cpp4067
-rw-r--r--source/Target/ThreadCollection.cpp90
-rw-r--r--source/Target/ThreadList.cpp1357
-rw-r--r--source/Target/ThreadPlan.cpp438
-rw-r--r--source/Target/ThreadPlanBase.cpp325
-rw-r--r--source/Target/ThreadPlanCallFunction.cpp885
-rw-r--r--source/Target/ThreadPlanCallFunctionUsingABI.cpp83
-rw-r--r--source/Target/ThreadPlanCallOnFunctionExit.cpp100
-rw-r--r--source/Target/ThreadPlanCallUserExpression.cpp129
-rw-r--r--source/Target/ThreadPlanPython.cpp277
-rw-r--r--source/Target/ThreadPlanRunToAddress.cpp352
-rw-r--r--source/Target/ThreadPlanShouldStopHere.cpp275
-rw-r--r--source/Target/ThreadPlanStepInRange.cpp893
-rw-r--r--source/Target/ThreadPlanStepInstruction.cpp426
-rw-r--r--source/Target/ThreadPlanStepOut.cpp868
-rw-r--r--source/Target/ThreadPlanStepOverBreakpoint.cpp266
-rw-r--r--source/Target/ThreadPlanStepOverRange.cpp723
-rw-r--r--source/Target/ThreadPlanStepRange.cpp818
-rw-r--r--source/Target/ThreadPlanStepThrough.cpp420
-rw-r--r--source/Target/ThreadPlanStepUntil.cpp596
-rw-r--r--source/Target/ThreadPlanTracer.cpp375
-rw-r--r--source/Target/ThreadSpec.cpp240
-rw-r--r--source/Target/UnixSignals.cpp476
-rw-r--r--source/Target/UnwindAssembly.cpp35
-rw-r--r--source/Utility/ARM64_DWARF_Registers.cpp316
-rw-r--r--source/Utility/ARM64_DWARF_Registers.h158
-rw-r--r--source/Utility/ARM64_ehframe_Registers.h145
-rw-r--r--source/Utility/ARM_DWARF_Registers.cpp1312
-rw-r--r--source/Utility/ARM_DWARF_Registers.h394
-rw-r--r--source/Utility/ARM_ehframe_Registers.h41
-rw-r--r--source/Utility/CMakeLists.txt3
-rw-r--r--source/Utility/ConvertEnum.cpp210
-rw-r--r--source/Utility/JSON.cpp1083
-rw-r--r--source/Utility/KQueue.cpp87
-rw-r--r--source/Utility/KQueue.h72
-rw-r--r--source/Utility/LLDBAssert.cpp35
-rw-r--r--source/Utility/ModuleCache.cpp540
-rw-r--r--source/Utility/ModuleCache.h55
-rw-r--r--source/Utility/NameMatches.cpp58
-rw-r--r--source/Utility/PseudoTerminal.cpp352
-rw-r--r--source/Utility/Range.cpp117
-rw-r--r--source/Utility/RegisterNumber.cpp208
-rw-r--r--source/Utility/SelectHelper.cpp260
-rw-r--r--source/Utility/SharingPtr.cpp193
-rw-r--r--source/Utility/StringExtractor.cpp705
-rw-r--r--source/Utility/StringExtractorGDBRemote.cpp967
-rw-r--r--source/Utility/StringExtractorGDBRemote.h367
-rw-r--r--source/Utility/StringLexer.cpp144
-rw-r--r--source/Utility/TaskPool.cpp102
-rw-r--r--source/Utility/TimeSpecTimeout.cpp48
-rw-r--r--source/Utility/TimeSpecTimeout.h90
-rw-r--r--source/Utility/UriParser.cpp105
-rw-r--r--source/Utility/UriParser.h33
-rw-r--r--source/lldb.cpp126
1182 files changed, 383863 insertions, 409297 deletions
diff --git a/source/API/CMakeLists.txt b/source/API/CMakeLists.txt
index 2ed42cac062e..7e1e66bee3b2 100644
--- a/source/API/CMakeLists.txt
+++ b/source/API/CMakeLists.txt
@@ -6,6 +6,16 @@ endif()
# for liblldb to link against
include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
+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()
+
add_lldb_library(liblldb SHARED
SBAddress.cpp
SBAttachInfo.cpp
@@ -47,6 +57,7 @@ add_lldb_library(liblldb SHARED
SBSourceManager.cpp
SBStream.cpp
SBStringList.cpp
+ SBStructuredData.cpp
SBSymbol.cpp
SBSymbolContext.cpp
SBSymbolContextList.cpp
@@ -71,6 +82,14 @@ add_lldb_library(liblldb SHARED
${LLDB_WRAP_PYTHON}
)
+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()
+endif()
+
# This should not be part of LLDBDependencies.cmake, because we don't
# want every single library taking a dependency on the script interpreters.
target_link_libraries(liblldb PRIVATE
@@ -88,16 +107,13 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
# If we're not exporting all symbols, we'll want to explicitly set
# the exported symbols here. This prevents 'log enable --stack ...'
# from working on some systems but limits the liblldb size.
- MESSAGE("-- Symbols (liblldb): only exporting liblldb.exports symbols")
+ MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb namespace")
add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
else()
# Don't use an explicit export. Instead, tell the linker to
# export all symbols.
- MESSAGE("-- Symbols (liblldb): exporting all symbols")
- # Darwin linker doesn't need this extra step.
- if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
- lldb_append_link_flags(liblldb "-Wl,--export-dynamic")
- endif()
+ MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and lldb_private namespaces")
+ add_llvm_symbol_exports(liblldb ${CMAKE_CURRENT_SOURCE_DIR}/liblldb-private.exports)
endif()
endif()
@@ -117,5 +133,22 @@ endif()
if (LLDB_WRAP_PYTHON)
add_dependencies(liblldb swig_wrapper)
endif()
-target_link_libraries(liblldb ${cmake_2_8_12_PRIVATE} ${LLDB_SYSTEM_LIBS})
+target_link_libraries(liblldb PRIVATE ${LLDB_SYSTEM_LIBS})
+
+if(LLDB_BUILD_FRAMEWORK)
+ file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
+ 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 "${public_headers}")
+
+ add_custom_command(TARGET liblldb POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:liblldb>/Versions/${LLDB_FRAMEWORK_VERSION}
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${LLDB_SOURCE_DIR}/include/lldb/API $<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 copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang
+ )
+endif()
diff --git a/source/API/SBAddress.cpp b/source/API/SBAddress.cpp
index 470ea5659f28..0ef374f47a92 100644
--- a/source/API/SBAddress.cpp
+++ b/source/API/SBAddress.cpp
@@ -18,312 +18,227 @@
#include "lldb/Symbol/LineEntry.h"
#include "lldb/Target/Target.h"
-
using namespace lldb;
using namespace lldb_private;
+SBAddress::SBAddress() : m_opaque_ap(new Address()) {}
-SBAddress::SBAddress () :
- m_opaque_ap (new Address())
-{
-}
-
-SBAddress::SBAddress (const Address *lldb_object_ptr) :
- m_opaque_ap (new Address())
-{
- if (lldb_object_ptr)
- ref() = *lldb_object_ptr;
+SBAddress::SBAddress(const Address *lldb_object_ptr)
+ : m_opaque_ap(new Address()) {
+ if (lldb_object_ptr)
+ ref() = *lldb_object_ptr;
}
-SBAddress::SBAddress (const SBAddress &rhs) :
- m_opaque_ap (new Address())
-{
- if (rhs.IsValid())
- ref() = rhs.ref();
+SBAddress::SBAddress(const SBAddress &rhs) : m_opaque_ap(new Address()) {
+ if (rhs.IsValid())
+ ref() = rhs.ref();
}
-
-SBAddress::SBAddress (lldb::SBSection section, lldb::addr_t offset) :
- m_opaque_ap(new Address (section.GetSP(), offset))
-{
-}
+SBAddress::SBAddress(lldb::SBSection section, lldb::addr_t offset)
+ : m_opaque_ap(new Address(section.GetSP(), offset)) {}
// Create an address by resolving a load address using the supplied target
-SBAddress::SBAddress (lldb::addr_t load_addr, lldb::SBTarget &target) :
- m_opaque_ap(new Address())
-{
- SetLoadAddress (load_addr, target);
+SBAddress::SBAddress(lldb::addr_t load_addr, lldb::SBTarget &target)
+ : m_opaque_ap(new Address()) {
+ SetLoadAddress(load_addr, target);
}
+SBAddress::~SBAddress() {}
-
-SBAddress::~SBAddress ()
-{
-}
-
-const SBAddress &
-SBAddress::operator = (const SBAddress &rhs)
-{
- if (this != &rhs)
- {
- if (rhs.IsValid())
- ref() = rhs.ref();
- else
- m_opaque_ap.reset (new Address());
- }
- return *this;
+const SBAddress &SBAddress::operator=(const SBAddress &rhs) {
+ if (this != &rhs) {
+ if (rhs.IsValid())
+ ref() = rhs.ref();
+ else
+ m_opaque_ap.reset(new Address());
+ }
+ return *this;
}
-bool
-SBAddress::IsValid () const
-{
- return m_opaque_ap.get() != NULL && m_opaque_ap->IsValid();
+bool SBAddress::IsValid() const {
+ return m_opaque_ap.get() != NULL && m_opaque_ap->IsValid();
}
-void
-SBAddress::Clear ()
-{
- m_opaque_ap.reset (new Address());
-}
+void SBAddress::Clear() { m_opaque_ap.reset(new Address()); }
-void
-SBAddress::SetAddress (lldb::SBSection section, lldb::addr_t offset)
-{
- Address &addr = ref();
- addr.SetSection (section.GetSP());
- addr.SetOffset (offset);
+void SBAddress::SetAddress(lldb::SBSection section, lldb::addr_t offset) {
+ Address &addr = ref();
+ addr.SetSection(section.GetSP());
+ addr.SetOffset(offset);
}
-
-void
-SBAddress::SetAddress (const Address *lldb_object_ptr)
-{
- if (lldb_object_ptr)
- ref() = *lldb_object_ptr;
- else
- m_opaque_ap.reset (new Address());
+void SBAddress::SetAddress(const Address *lldb_object_ptr) {
+ if (lldb_object_ptr)
+ ref() = *lldb_object_ptr;
+ else
+ m_opaque_ap.reset(new Address());
}
-lldb::addr_t
-SBAddress::GetFileAddress () const
-{
- if (m_opaque_ap->IsValid())
- return m_opaque_ap->GetFileAddress();
- else
- return LLDB_INVALID_ADDRESS;
+lldb::addr_t SBAddress::GetFileAddress() const {
+ if (m_opaque_ap->IsValid())
+ return m_opaque_ap->GetFileAddress();
+ else
+ return LLDB_INVALID_ADDRESS;
}
-lldb::addr_t
-SBAddress::GetLoadAddress (const SBTarget &target) const
-{
- Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- lldb::addr_t addr = LLDB_INVALID_ADDRESS;
- TargetSP target_sp (target.GetSP());
- if (target_sp)
- {
- if (m_opaque_ap->IsValid())
- {
- std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
- addr = m_opaque_ap->GetLoadAddress (target_sp.get());
- }
- }
+lldb::addr_t SBAddress::GetLoadAddress(const SBTarget &target) const {
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- {
- if (addr == LLDB_INVALID_ADDRESS)
- log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS",
- static_cast<void*>(target_sp.get()));
- else
- log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64,
- static_cast<void*>(target_sp.get()), addr);
+ lldb::addr_t addr = LLDB_INVALID_ADDRESS;
+ TargetSP target_sp(target.GetSP());
+ if (target_sp) {
+ if (m_opaque_ap->IsValid()) {
+ std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
+ addr = m_opaque_ap->GetLoadAddress(target_sp.get());
}
+ }
- return addr;
-}
-
-void
-SBAddress::SetLoadAddress (lldb::addr_t load_addr, lldb::SBTarget &target)
-{
- // Create the address object if we don't already have one
- ref();
- if (target.IsValid())
- *this = target.ResolveLoadAddress(load_addr);
+ if (log) {
+ if (addr == LLDB_INVALID_ADDRESS)
+ log->Printf(
+ "SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS",
+ static_cast<void *>(target_sp.get()));
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
- if (!m_opaque_ap->IsValid())
- m_opaque_ap->SetOffset(load_addr);
-}
-
-bool
-SBAddress::OffsetAddress (addr_t offset)
-{
- if (m_opaque_ap->IsValid())
- {
- addr_t addr_offset = m_opaque_ap->GetOffset();
- if (addr_offset != LLDB_INVALID_ADDRESS)
- {
- m_opaque_ap->SetOffset(addr_offset + offset);
- return true;
- }
+ log->Printf("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64,
+ static_cast<void *>(target_sp.get()), addr);
+ }
+
+ return addr;
+}
+
+void SBAddress::SetLoadAddress(lldb::addr_t load_addr, lldb::SBTarget &target) {
+ // Create the address object if we don't already have one
+ ref();
+ if (target.IsValid())
+ *this = target.ResolveLoadAddress(load_addr);
+ 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
+ if (!m_opaque_ap->IsValid())
+ m_opaque_ap->SetOffset(load_addr);
+}
+
+bool SBAddress::OffsetAddress(addr_t offset) {
+ if (m_opaque_ap->IsValid()) {
+ addr_t addr_offset = m_opaque_ap->GetOffset();
+ if (addr_offset != LLDB_INVALID_ADDRESS) {
+ m_opaque_ap->SetOffset(addr_offset + offset);
+ return true;
}
- return false;
+ }
+ return false;
}
-lldb::SBSection
-SBAddress::GetSection ()
-{
- lldb::SBSection sb_section;
- if (m_opaque_ap->IsValid())
- sb_section.SetSP (m_opaque_ap->GetSection());
- return sb_section;
+lldb::SBSection SBAddress::GetSection() {
+ lldb::SBSection sb_section;
+ if (m_opaque_ap->IsValid())
+ sb_section.SetSP(m_opaque_ap->GetSection());
+ return sb_section;
}
-lldb::addr_t
-SBAddress::GetOffset ()
-{
- if (m_opaque_ap->IsValid())
- return m_opaque_ap->GetOffset();
- return 0;
+lldb::addr_t SBAddress::GetOffset() {
+ if (m_opaque_ap->IsValid())
+ return m_opaque_ap->GetOffset();
+ return 0;
}
-Address *
-SBAddress::operator->()
-{
- return m_opaque_ap.get();
-}
+Address *SBAddress::operator->() { return m_opaque_ap.get(); }
-const Address *
-SBAddress::operator->() const
-{
- return m_opaque_ap.get();
-}
+const Address *SBAddress::operator->() const { return m_opaque_ap.get(); }
-Address &
-SBAddress::ref ()
-{
- if (m_opaque_ap.get() == NULL)
- m_opaque_ap.reset (new Address());
- return *m_opaque_ap;
+Address &SBAddress::ref() {
+ if (m_opaque_ap.get() == NULL)
+ m_opaque_ap.reset(new Address());
+ return *m_opaque_ap;
}
-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.
- assert (m_opaque_ap.get());
- return *m_opaque_ap;
+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.
+ assert(m_opaque_ap.get());
+ return *m_opaque_ap;
}
-Address *
-SBAddress::get ()
-{
- return m_opaque_ap.get();
-}
+Address *SBAddress::get() { return m_opaque_ap.get(); }
-bool
-SBAddress::GetDescription (SBStream &description)
-{
- // Call "ref()" on the stream to make sure it creates a backing stream in
- // case there isn't one already...
- Stream &strm = description.ref();
- if (m_opaque_ap->IsValid())
- {
- m_opaque_ap->Dump (&strm,
- NULL,
- Address::DumpStyleResolvedDescription,
- Address::DumpStyleModuleWithFileAddress,
- 4);
- StreamString sstrm;
-// m_opaque_ap->Dump (&sstrm, NULL, Address::DumpStyleResolvedDescription, Address::DumpStyleInvalid, 4);
-// if (sstrm.GetData())
-// strm.Printf (" (%s)", sstrm.GetData());
- }
- else
- strm.PutCString ("No value");
+bool SBAddress::GetDescription(SBStream &description) {
+ // Call "ref()" on the stream to make sure it creates a backing stream in
+ // case there isn't one already...
+ Stream &strm = description.ref();
+ if (m_opaque_ap->IsValid()) {
+ m_opaque_ap->Dump(&strm, NULL, Address::DumpStyleResolvedDescription,
+ Address::DumpStyleModuleWithFileAddress, 4);
+ StreamString sstrm;
+ // m_opaque_ap->Dump (&sstrm, NULL,
+ // Address::DumpStyleResolvedDescription, Address::DumpStyleInvalid,
+ // 4);
+ // if (sstrm.GetData())
+ // strm.Printf (" (%s)", sstrm.GetData());
+ } else
+ strm.PutCString("No value");
- return true;
+ return true;
}
-SBModule
-SBAddress::GetModule ()
-{
- SBModule sb_module;
- if (m_opaque_ap->IsValid())
- sb_module.SetSP (m_opaque_ap->GetModule());
- return sb_module;
+SBModule SBAddress::GetModule() {
+ SBModule sb_module;
+ if (m_opaque_ap->IsValid())
+ sb_module.SetSP(m_opaque_ap->GetModule());
+ return sb_module;
}
-SBSymbolContext
-SBAddress::GetSymbolContext (uint32_t resolve_scope)
-{
- SBSymbolContext sb_sc;
- if (m_opaque_ap->IsValid())
- m_opaque_ap->CalculateSymbolContext (&sb_sc.ref(), resolve_scope);
- return sb_sc;
+SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) {
+ SBSymbolContext sb_sc;
+ if (m_opaque_ap->IsValid())
+ m_opaque_ap->CalculateSymbolContext(&sb_sc.ref(), resolve_scope);
+ return sb_sc;
}
-SBCompileUnit
-SBAddress::GetCompileUnit ()
-{
- SBCompileUnit sb_comp_unit;
- if (m_opaque_ap->IsValid())
- sb_comp_unit.reset(m_opaque_ap->CalculateSymbolContextCompileUnit());
- return sb_comp_unit;
+SBCompileUnit SBAddress::GetCompileUnit() {
+ SBCompileUnit sb_comp_unit;
+ if (m_opaque_ap->IsValid())
+ sb_comp_unit.reset(m_opaque_ap->CalculateSymbolContextCompileUnit());
+ return sb_comp_unit;
}
-SBFunction
-SBAddress::GetFunction ()
-{
- SBFunction sb_function;
- if (m_opaque_ap->IsValid())
- sb_function.reset(m_opaque_ap->CalculateSymbolContextFunction());
- return sb_function;
+SBFunction SBAddress::GetFunction() {
+ SBFunction sb_function;
+ if (m_opaque_ap->IsValid())
+ sb_function.reset(m_opaque_ap->CalculateSymbolContextFunction());
+ return sb_function;
}
-SBBlock
-SBAddress::GetBlock ()
-{
- SBBlock sb_block;
- if (m_opaque_ap->IsValid())
- sb_block.SetPtr(m_opaque_ap->CalculateSymbolContextBlock());
- return sb_block;
+SBBlock SBAddress::GetBlock() {
+ SBBlock sb_block;
+ if (m_opaque_ap->IsValid())
+ sb_block.SetPtr(m_opaque_ap->CalculateSymbolContextBlock());
+ return sb_block;
}
-SBSymbol
-SBAddress::GetSymbol ()
-{
- SBSymbol sb_symbol;
- if (m_opaque_ap->IsValid())
- sb_symbol.reset(m_opaque_ap->CalculateSymbolContextSymbol());
- return sb_symbol;
+SBSymbol SBAddress::GetSymbol() {
+ SBSymbol sb_symbol;
+ if (m_opaque_ap->IsValid())
+ sb_symbol.reset(m_opaque_ap->CalculateSymbolContextSymbol());
+ return sb_symbol;
}
-SBLineEntry
-SBAddress::GetLineEntry ()
-{
- SBLineEntry sb_line_entry;
- if (m_opaque_ap->IsValid())
- {
- LineEntry line_entry;
- if (m_opaque_ap->CalculateSymbolContextLineEntry (line_entry))
- sb_line_entry.SetLineEntry (line_entry);
- }
- return sb_line_entry;
+SBLineEntry SBAddress::GetLineEntry() {
+ SBLineEntry sb_line_entry;
+ if (m_opaque_ap->IsValid()) {
+ LineEntry line_entry;
+ if (m_opaque_ap->CalculateSymbolContextLineEntry(line_entry))
+ sb_line_entry.SetLineEntry(line_entry);
+ }
+ return sb_line_entry;
}
-AddressClass
-SBAddress::GetAddressClass ()
-{
- if (m_opaque_ap->IsValid())
- return m_opaque_ap->GetAddressClass();
- return eAddressClassInvalid;
+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 0f2ab7afc9c2..e6500c468ec5 100644
--- a/source/API/SBAttachInfo.cpp
+++ b/source/API/SBAttachInfo.cpp
@@ -16,243 +16,152 @@
using namespace lldb;
using namespace lldb_private;
+SBAttachInfo::SBAttachInfo() : m_opaque_sp(new ProcessAttachInfo()) {}
-SBAttachInfo::SBAttachInfo () :
- m_opaque_sp (new ProcessAttachInfo())
-{
+SBAttachInfo::SBAttachInfo(lldb::pid_t pid)
+ : m_opaque_sp(new ProcessAttachInfo()) {
+ m_opaque_sp->SetProcessID(pid);
}
-SBAttachInfo::SBAttachInfo (lldb::pid_t pid) :
- m_opaque_sp (new ProcessAttachInfo())
-{
- m_opaque_sp->SetProcessID (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->SetWaitForLaunch(wait_for);
}
-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->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->SetWaitForLaunch(wait_for);
+ m_opaque_sp->SetAsync(async);
}
-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->SetWaitForLaunch (wait_for);
- m_opaque_sp->SetAsync(async);
+SBAttachInfo::SBAttachInfo(const SBAttachInfo &rhs)
+ : m_opaque_sp(new ProcessAttachInfo()) {
+ *m_opaque_sp = *rhs.m_opaque_sp;
}
-SBAttachInfo::SBAttachInfo (const SBAttachInfo &rhs) :
- m_opaque_sp (new ProcessAttachInfo())
-{
- *m_opaque_sp = *rhs.m_opaque_sp;
-}
+SBAttachInfo::~SBAttachInfo() {}
-SBAttachInfo::~SBAttachInfo()
-{
-}
+lldb_private::ProcessAttachInfo &SBAttachInfo::ref() { return *m_opaque_sp; }
-lldb_private::ProcessAttachInfo &
-SBAttachInfo::ref ()
-{
- return *m_opaque_sp;
-}
-
-SBAttachInfo &
-SBAttachInfo::operator = (const SBAttachInfo &rhs)
-{
- if (this != &rhs)
- *m_opaque_sp = *rhs.m_opaque_sp;
- return *this;
+SBAttachInfo &SBAttachInfo::operator=(const SBAttachInfo &rhs) {
+ if (this != &rhs)
+ *m_opaque_sp = *rhs.m_opaque_sp;
+ return *this;
}
-lldb::pid_t
-SBAttachInfo::GetProcessID ()
-{
- return m_opaque_sp->GetProcessID();
-}
+lldb::pid_t SBAttachInfo::GetProcessID() { return m_opaque_sp->GetProcessID(); }
-void
-SBAttachInfo::SetProcessID (lldb::pid_t pid)
-{
- m_opaque_sp->SetProcessID (pid);
+void SBAttachInfo::SetProcessID(lldb::pid_t pid) {
+ m_opaque_sp->SetProcessID(pid);
}
-
-uint32_t
-SBAttachInfo::GetResumeCount ()
-{
- return m_opaque_sp->GetResumeCount();
+uint32_t SBAttachInfo::GetResumeCount() {
+ return m_opaque_sp->GetResumeCount();
}
-void
-SBAttachInfo::SetResumeCount (uint32_t c)
-{
- m_opaque_sp->SetResumeCount (c);
+void SBAttachInfo::SetResumeCount(uint32_t c) {
+ m_opaque_sp->SetResumeCount(c);
}
-const char *
-SBAttachInfo::GetProcessPluginName ()
-{
- return m_opaque_sp->GetProcessPluginName();
+const char *SBAttachInfo::GetProcessPluginName() {
+ return m_opaque_sp->GetProcessPluginName();
}
-void
-SBAttachInfo::SetProcessPluginName (const char *plugin_name)
-{
- return m_opaque_sp->SetProcessPluginName (plugin_name);
+void SBAttachInfo::SetProcessPluginName(const char *plugin_name) {
+ return m_opaque_sp->SetProcessPluginName(plugin_name);
}
-void
-SBAttachInfo::SetExecutable (const char *path)
-{
- if (path && path[0])
- m_opaque_sp->GetExecutableFile().SetFile(path, false);
- else
- m_opaque_sp->GetExecutableFile().Clear();
+void SBAttachInfo::SetExecutable(const char *path) {
+ if (path && path[0])
+ m_opaque_sp->GetExecutableFile().SetFile(path, false);
+ else
+ m_opaque_sp->GetExecutableFile().Clear();
}
-void
-SBAttachInfo::SetExecutable (SBFileSpec exe_file)
-{
- if (exe_file.IsValid())
- m_opaque_sp->GetExecutableFile() = exe_file.ref();
- else
- m_opaque_sp->GetExecutableFile().Clear();
+void SBAttachInfo::SetExecutable(SBFileSpec exe_file) {
+ if (exe_file.IsValid())
+ m_opaque_sp->GetExecutableFile() = exe_file.ref();
+ else
+ m_opaque_sp->GetExecutableFile().Clear();
}
-bool
-SBAttachInfo::GetWaitForLaunch ()
-{
- return m_opaque_sp->GetWaitForLaunch();
+bool SBAttachInfo::GetWaitForLaunch() {
+ return m_opaque_sp->GetWaitForLaunch();
}
-void
-SBAttachInfo::SetWaitForLaunch (bool b)
-{
- m_opaque_sp->SetWaitForLaunch (b);
+void SBAttachInfo::SetWaitForLaunch(bool b) {
+ m_opaque_sp->SetWaitForLaunch(b);
}
-void
-SBAttachInfo::SetWaitForLaunch (bool b, bool async)
-{
- m_opaque_sp->SetWaitForLaunch (b);
- m_opaque_sp->SetAsync(async);
+void SBAttachInfo::SetWaitForLaunch(bool b, bool async) {
+ m_opaque_sp->SetWaitForLaunch(b);
+ m_opaque_sp->SetAsync(async);
}
-bool
-SBAttachInfo::GetIgnoreExisting ()
-{
- return m_opaque_sp->GetIgnoreExisting();
+bool SBAttachInfo::GetIgnoreExisting() {
+ return m_opaque_sp->GetIgnoreExisting();
}
-void
-SBAttachInfo::SetIgnoreExisting (bool b)
-{
- m_opaque_sp->SetIgnoreExisting (b);
+void SBAttachInfo::SetIgnoreExisting(bool b) {
+ m_opaque_sp->SetIgnoreExisting(b);
}
-uint32_t
-SBAttachInfo::GetUserID()
-{
- return m_opaque_sp->GetUserID();
-}
+uint32_t SBAttachInfo::GetUserID() { return m_opaque_sp->GetUserID(); }
-uint32_t
-SBAttachInfo::GetGroupID()
-{
- return m_opaque_sp->GetGroupID();
-}
+uint32_t SBAttachInfo::GetGroupID() { return m_opaque_sp->GetGroupID(); }
-bool
-SBAttachInfo::UserIDIsValid ()
-{
- return m_opaque_sp->UserIDIsValid();
-}
+bool SBAttachInfo::UserIDIsValid() { return m_opaque_sp->UserIDIsValid(); }
-bool
-SBAttachInfo::GroupIDIsValid ()
-{
- return m_opaque_sp->GroupIDIsValid();
-}
+bool SBAttachInfo::GroupIDIsValid() { return m_opaque_sp->GroupIDIsValid(); }
-void
-SBAttachInfo::SetUserID (uint32_t uid)
-{
- m_opaque_sp->SetUserID (uid);
-}
+void SBAttachInfo::SetUserID(uint32_t uid) { m_opaque_sp->SetUserID(uid); }
-void
-SBAttachInfo::SetGroupID (uint32_t gid)
-{
- m_opaque_sp->SetGroupID (gid);
-}
+void SBAttachInfo::SetGroupID(uint32_t gid) { m_opaque_sp->SetGroupID(gid); }
-uint32_t
-SBAttachInfo::GetEffectiveUserID()
-{
- return m_opaque_sp->GetEffectiveUserID();
+uint32_t SBAttachInfo::GetEffectiveUserID() {
+ return m_opaque_sp->GetEffectiveUserID();
}
-uint32_t
-SBAttachInfo::GetEffectiveGroupID()
-{
- return m_opaque_sp->GetEffectiveGroupID();
+uint32_t SBAttachInfo::GetEffectiveGroupID() {
+ return m_opaque_sp->GetEffectiveGroupID();
}
-bool
-SBAttachInfo::EffectiveUserIDIsValid ()
-{
- return m_opaque_sp->EffectiveUserIDIsValid();
+bool SBAttachInfo::EffectiveUserIDIsValid() {
+ return m_opaque_sp->EffectiveUserIDIsValid();
}
-bool
-SBAttachInfo::EffectiveGroupIDIsValid ()
-{
- return m_opaque_sp->EffectiveGroupIDIsValid ();
+bool SBAttachInfo::EffectiveGroupIDIsValid() {
+ return m_opaque_sp->EffectiveGroupIDIsValid();
}
-void
-SBAttachInfo::SetEffectiveUserID (uint32_t uid)
-{
- m_opaque_sp->SetEffectiveUserID(uid);
+void SBAttachInfo::SetEffectiveUserID(uint32_t uid) {
+ m_opaque_sp->SetEffectiveUserID(uid);
}
-void
-SBAttachInfo::SetEffectiveGroupID (uint32_t gid)
-{
- m_opaque_sp->SetEffectiveGroupID(gid);
+void SBAttachInfo::SetEffectiveGroupID(uint32_t gid) {
+ m_opaque_sp->SetEffectiveGroupID(gid);
}
-lldb::pid_t
-SBAttachInfo::GetParentProcessID ()
-{
- return m_opaque_sp->GetParentProcessID();
+lldb::pid_t SBAttachInfo::GetParentProcessID() {
+ return m_opaque_sp->GetParentProcessID();
}
-void
-SBAttachInfo::SetParentProcessID (lldb::pid_t pid)
-{
- m_opaque_sp->SetParentProcessID (pid);
+void SBAttachInfo::SetParentProcessID(lldb::pid_t pid) {
+ m_opaque_sp->SetParentProcessID(pid);
}
-bool
-SBAttachInfo::ParentProcessIDIsValid()
-{
- return m_opaque_sp->ParentProcessIDIsValid();
+bool SBAttachInfo::ParentProcessIDIsValid() {
+ return m_opaque_sp->ParentProcessIDIsValid();
}
-SBListener
-SBAttachInfo::GetListener ()
-{
- return SBListener(m_opaque_sp->GetListener());
+SBListener SBAttachInfo::GetListener() {
+ return SBListener(m_opaque_sp->GetListener());
}
-void
-SBAttachInfo::SetListener (SBListener &listener)
-{
- m_opaque_sp->SetListener(listener.GetSP());
+void SBAttachInfo::SetListener(SBListener &listener) {
+ m_opaque_sp->SetListener(listener.GetSP());
}
diff --git a/source/API/SBBlock.cpp b/source/API/SBBlock.cpp
index 03ee7343c9f5..471b7fbebb23 100644
--- a/source/API/SBBlock.cpp
+++ b/source/API/SBBlock.cpp
@@ -26,362 +26,272 @@
using namespace lldb;
using namespace lldb_private;
+SBBlock::SBBlock() : m_opaque_ptr(NULL) {}
-SBBlock::SBBlock () :
- m_opaque_ptr (NULL)
-{
-}
+SBBlock::SBBlock(lldb_private::Block *lldb_object_ptr)
+ : m_opaque_ptr(lldb_object_ptr) {}
-SBBlock::SBBlock (lldb_private::Block *lldb_object_ptr) :
- m_opaque_ptr (lldb_object_ptr)
-{
-}
+SBBlock::SBBlock(const SBBlock &rhs) : m_opaque_ptr(rhs.m_opaque_ptr) {}
-SBBlock::SBBlock(const SBBlock &rhs) :
- m_opaque_ptr (rhs.m_opaque_ptr)
-{
+const SBBlock &SBBlock::operator=(const SBBlock &rhs) {
+ m_opaque_ptr = rhs.m_opaque_ptr;
+ return *this;
}
-const SBBlock &
-SBBlock::operator = (const SBBlock &rhs)
-{
- m_opaque_ptr = rhs.m_opaque_ptr;
- return *this;
-}
+SBBlock::~SBBlock() { m_opaque_ptr = NULL; }
-SBBlock::~SBBlock ()
-{
- m_opaque_ptr = NULL;
-}
+bool SBBlock::IsValid() const { return m_opaque_ptr != NULL; }
-bool
-SBBlock::IsValid () const
-{
- return m_opaque_ptr != NULL;
+bool SBBlock::IsInlined() const {
+ if (m_opaque_ptr)
+ return m_opaque_ptr->GetInlinedFunctionInfo() != NULL;
+ return false;
}
-bool
-SBBlock::IsInlined () const
-{
- if (m_opaque_ptr)
- return m_opaque_ptr->GetInlinedFunctionInfo () != NULL;
- return false;
-}
-
-const char *
-SBBlock::GetInlinedName () const
-{
- if (m_opaque_ptr)
- {
- const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
- if (inlined_info)
- {
- Function *function = m_opaque_ptr->CalculateSymbolContextFunction();
- LanguageType language;
- if (function)
- language = function->GetLanguage();
- else
- language = lldb::eLanguageTypeUnknown;
- return inlined_info->GetName(language).AsCString (NULL);
- }
+const char *SBBlock::GetInlinedName() const {
+ if (m_opaque_ptr) {
+ const InlineFunctionInfo *inlined_info =
+ m_opaque_ptr->GetInlinedFunctionInfo();
+ if (inlined_info) {
+ Function *function = m_opaque_ptr->CalculateSymbolContextFunction();
+ LanguageType language;
+ if (function)
+ language = function->GetLanguage();
+ else
+ language = lldb::eLanguageTypeUnknown;
+ return inlined_info->GetName(language).AsCString(NULL);
}
- return NULL;
+ }
+ return NULL;
}
-SBFileSpec
-SBBlock::GetInlinedCallSiteFile () const
-{
- SBFileSpec sb_file;
- if (m_opaque_ptr)
- {
- const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
- if (inlined_info)
- sb_file.SetFileSpec (inlined_info->GetCallSite().GetFile());
- }
- return sb_file;
+SBFileSpec SBBlock::GetInlinedCallSiteFile() const {
+ SBFileSpec sb_file;
+ if (m_opaque_ptr) {
+ const InlineFunctionInfo *inlined_info =
+ m_opaque_ptr->GetInlinedFunctionInfo();
+ if (inlined_info)
+ sb_file.SetFileSpec(inlined_info->GetCallSite().GetFile());
+ }
+ return sb_file;
}
-uint32_t
-SBBlock::GetInlinedCallSiteLine () const
-{
- if (m_opaque_ptr)
- {
- const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
- if (inlined_info)
- return inlined_info->GetCallSite().GetLine();
- }
- return 0;
+uint32_t SBBlock::GetInlinedCallSiteLine() const {
+ if (m_opaque_ptr) {
+ const InlineFunctionInfo *inlined_info =
+ m_opaque_ptr->GetInlinedFunctionInfo();
+ if (inlined_info)
+ return inlined_info->GetCallSite().GetLine();
+ }
+ return 0;
}
-uint32_t
-SBBlock::GetInlinedCallSiteColumn () const
-{
- if (m_opaque_ptr)
- {
- const InlineFunctionInfo* inlined_info = m_opaque_ptr->GetInlinedFunctionInfo ();
- if (inlined_info)
- return inlined_info->GetCallSite().GetColumn();
- }
- return 0;
+uint32_t SBBlock::GetInlinedCallSiteColumn() const {
+ if (m_opaque_ptr) {
+ const InlineFunctionInfo *inlined_info =
+ m_opaque_ptr->GetInlinedFunctionInfo();
+ if (inlined_info)
+ return inlined_info->GetCallSite().GetColumn();
+ }
+ return 0;
}
-void
-SBBlock::AppendVariables (bool can_create, bool get_parent_variables, lldb_private::VariableList *var_list)
-{
- if (IsValid())
- {
- bool show_inline = true;
- m_opaque_ptr->AppendVariables (can_create,
- get_parent_variables,
- show_inline,
- [](Variable*) { return true; },
- var_list);
- }
+void SBBlock::AppendVariables(bool can_create, bool get_parent_variables,
+ lldb_private::VariableList *var_list) {
+ if (IsValid()) {
+ bool show_inline = true;
+ m_opaque_ptr->AppendVariables(can_create, get_parent_variables, show_inline,
+ [](Variable *) { return true; }, var_list);
+ }
}
-SBBlock
-SBBlock::GetParent ()
-{
- SBBlock sb_block;
- if (m_opaque_ptr)
- sb_block.m_opaque_ptr = m_opaque_ptr->GetParent();
- return sb_block;
+SBBlock SBBlock::GetParent() {
+ SBBlock sb_block;
+ if (m_opaque_ptr)
+ sb_block.m_opaque_ptr = m_opaque_ptr->GetParent();
+ return sb_block;
}
-lldb::SBBlock
-SBBlock::GetContainingInlinedBlock ()
-{
- SBBlock sb_block;
- if (m_opaque_ptr)
- sb_block.m_opaque_ptr = m_opaque_ptr->GetContainingInlinedBlock ();
- return sb_block;
+lldb::SBBlock SBBlock::GetContainingInlinedBlock() {
+ SBBlock sb_block;
+ if (m_opaque_ptr)
+ sb_block.m_opaque_ptr = m_opaque_ptr->GetContainingInlinedBlock();
+ return sb_block;
}
-SBBlock
-SBBlock::GetSibling ()
-{
- SBBlock sb_block;
- if (m_opaque_ptr)
- sb_block.m_opaque_ptr = m_opaque_ptr->GetSibling();
- return sb_block;
+SBBlock SBBlock::GetSibling() {
+ SBBlock sb_block;
+ if (m_opaque_ptr)
+ sb_block.m_opaque_ptr = m_opaque_ptr->GetSibling();
+ return sb_block;
}
-SBBlock
-SBBlock::GetFirstChild ()
-{
- SBBlock sb_block;
- if (m_opaque_ptr)
- sb_block.m_opaque_ptr = m_opaque_ptr->GetFirstChild();
- return sb_block;
+SBBlock SBBlock::GetFirstChild() {
+ SBBlock sb_block;
+ if (m_opaque_ptr)
+ sb_block.m_opaque_ptr = m_opaque_ptr->GetFirstChild();
+ return sb_block;
}
-lldb_private::Block *
-SBBlock::GetPtr ()
-{
- return m_opaque_ptr;
-}
+lldb_private::Block *SBBlock::GetPtr() { return m_opaque_ptr; }
-void
-SBBlock::SetPtr (lldb_private::Block *block)
-{
- m_opaque_ptr = block;
-}
+void SBBlock::SetPtr(lldb_private::Block *block) { m_opaque_ptr = block; }
-bool
-SBBlock::GetDescription (SBStream &description)
-{
- Stream &strm = description.ref();
-
- if (m_opaque_ptr)
- {
- lldb::user_id_t id = m_opaque_ptr->GetID();
- strm.Printf ("Block: {id: %" PRIu64 "} ", id);
- if (IsInlined())
- {
- strm.Printf (" (inlined, '%s') ", GetInlinedName());
- }
- lldb_private::SymbolContext sc;
- m_opaque_ptr->CalculateSymbolContext (&sc);
- if (sc.function)
- {
- m_opaque_ptr->DumpAddressRanges (&strm,
- sc.function->GetAddressRange().GetBaseAddress().GetFileAddress());
- }
+bool SBBlock::GetDescription(SBStream &description) {
+ Stream &strm = description.ref();
+
+ if (m_opaque_ptr) {
+ lldb::user_id_t id = m_opaque_ptr->GetID();
+ strm.Printf("Block: {id: %" PRIu64 "} ", id);
+ if (IsInlined()) {
+ strm.Printf(" (inlined, '%s') ", GetInlinedName());
}
- else
- strm.PutCString ("No value");
-
- return true;
+ lldb_private::SymbolContext sc;
+ m_opaque_ptr->CalculateSymbolContext(&sc);
+ if (sc.function) {
+ m_opaque_ptr->DumpAddressRanges(
+ &strm,
+ sc.function->GetAddressRange().GetBaseAddress().GetFileAddress());
+ }
+ } else
+ strm.PutCString("No value");
+
+ return true;
}
-uint32_t
-SBBlock::GetNumRanges ()
-{
- if (m_opaque_ptr)
- return m_opaque_ptr->GetNumRanges();
- return 0;
+uint32_t SBBlock::GetNumRanges() {
+ if (m_opaque_ptr)
+ return m_opaque_ptr->GetNumRanges();
+ return 0;
}
-lldb::SBAddress
-SBBlock::GetRangeStartAddress (uint32_t idx)
-{
- lldb::SBAddress sb_addr;
- if (m_opaque_ptr)
- {
- AddressRange range;
- if (m_opaque_ptr->GetRangeAtIndex(idx, range))
- {
- sb_addr.ref() = range.GetBaseAddress();
- }
+lldb::SBAddress SBBlock::GetRangeStartAddress(uint32_t idx) {
+ lldb::SBAddress sb_addr;
+ if (m_opaque_ptr) {
+ AddressRange range;
+ if (m_opaque_ptr->GetRangeAtIndex(idx, range)) {
+ sb_addr.ref() = range.GetBaseAddress();
}
- return sb_addr;
+ }
+ return sb_addr;
}
-lldb::SBAddress
-SBBlock::GetRangeEndAddress (uint32_t idx)
-{
- lldb::SBAddress sb_addr;
- if (m_opaque_ptr)
- {
- AddressRange range;
- if (m_opaque_ptr->GetRangeAtIndex(idx, range))
- {
- sb_addr.ref() = range.GetBaseAddress();
- sb_addr.ref().Slide(range.GetByteSize());
- }
+lldb::SBAddress SBBlock::GetRangeEndAddress(uint32_t idx) {
+ lldb::SBAddress sb_addr;
+ if (m_opaque_ptr) {
+ AddressRange range;
+ if (m_opaque_ptr->GetRangeAtIndex(idx, range)) {
+ sb_addr.ref() = range.GetBaseAddress();
+ sb_addr.ref().Slide(range.GetByteSize());
}
- return sb_addr;
+ }
+ return sb_addr;
}
-uint32_t
-SBBlock::GetRangeIndexForBlockAddress (lldb::SBAddress block_addr)
-{
- if (m_opaque_ptr && block_addr.IsValid())
- {
- return m_opaque_ptr->GetRangeIndexContainingAddress (block_addr.ref());
- }
+uint32_t SBBlock::GetRangeIndexForBlockAddress(lldb::SBAddress block_addr) {
+ if (m_opaque_ptr && block_addr.IsValid()) {
+ return m_opaque_ptr->GetRangeIndexContainingAddress(block_addr.ref());
+ }
- return UINT32_MAX;
+ return UINT32_MAX;
}
-
-lldb::SBValueList
-SBBlock::GetVariables (lldb::SBFrame& frame,
- bool arguments,
- bool locals,
- bool statics,
- lldb::DynamicValueType use_dynamic)
-{
- Block *block = GetPtr();
- SBValueList value_list;
- if (block)
- {
- StackFrameSP frame_sp(frame.GetFrameSP());
- VariableListSP variable_list_sp (block->GetBlockVariableList (true));
-
- if (variable_list_sp)
- {
- const size_t num_variables = variable_list_sp->GetSize();
- if (num_variables)
- {
- for (size_t i = 0; i < num_variables; ++i)
- {
- VariableSP variable_sp (variable_list_sp->GetVariableAtIndex(i));
- if (variable_sp)
- {
- bool add_variable = false;
- switch (variable_sp->GetScope())
- {
- case eValueTypeVariableGlobal:
- case eValueTypeVariableStatic:
- case eValueTypeVariableThreadLocal:
- add_variable = statics;
- break;
-
- case eValueTypeVariableArgument:
- add_variable = arguments;
- break;
-
- case eValueTypeVariableLocal:
- add_variable = locals;
- break;
-
- default:
- break;
- }
- if (add_variable)
- {
- if (frame_sp)
- {
- lldb::ValueObjectSP valobj_sp(frame_sp->GetValueObjectForFrameVariable (variable_sp,eNoDynamicValues));
- SBValue value_sb;
- value_sb.SetSP(valobj_sp, use_dynamic);
- value_list.Append (value_sb);
- }
- }
- }
- }
+lldb::SBValueList SBBlock::GetVariables(lldb::SBFrame &frame, bool arguments,
+ bool locals, bool statics,
+ lldb::DynamicValueType use_dynamic) {
+ Block *block = GetPtr();
+ SBValueList value_list;
+ if (block) {
+ StackFrameSP frame_sp(frame.GetFrameSP());
+ VariableListSP variable_list_sp(block->GetBlockVariableList(true));
+
+ if (variable_list_sp) {
+ const size_t num_variables = variable_list_sp->GetSize();
+ if (num_variables) {
+ for (size_t i = 0; i < num_variables; ++i) {
+ VariableSP variable_sp(variable_list_sp->GetVariableAtIndex(i));
+ if (variable_sp) {
+ bool add_variable = false;
+ switch (variable_sp->GetScope()) {
+ case eValueTypeVariableGlobal:
+ case eValueTypeVariableStatic:
+ case eValueTypeVariableThreadLocal:
+ add_variable = statics;
+ break;
+
+ case eValueTypeVariableArgument:
+ add_variable = arguments;
+ break;
+
+ case eValueTypeVariableLocal:
+ add_variable = locals;
+ break;
+
+ default:
+ break;
+ }
+ if (add_variable) {
+ if (frame_sp) {
+ lldb::ValueObjectSP valobj_sp(
+ frame_sp->GetValueObjectForFrameVariable(variable_sp,
+ eNoDynamicValues));
+ SBValue value_sb;
+ value_sb.SetSP(valobj_sp, use_dynamic);
+ value_list.Append(value_sb);
+ }
}
- }
+ }
+ }
+ }
}
- return value_list;
+ }
+ return value_list;
}
-lldb::SBValueList
-SBBlock::GetVariables (lldb::SBTarget& target,
- bool arguments,
- bool locals,
- bool statics)
-{
- Block *block = GetPtr();
-
- SBValueList value_list;
- if (block)
- {
- TargetSP target_sp(target.GetSP());
-
- VariableListSP variable_list_sp (block->GetBlockVariableList (true));
-
- if (variable_list_sp)
- {
- const size_t num_variables = variable_list_sp->GetSize();
- if (num_variables)
- {
- for (size_t i = 0; i < num_variables; ++i)
- {
- VariableSP variable_sp (variable_list_sp->GetVariableAtIndex(i));
- if (variable_sp)
- {
- bool add_variable = false;
- switch (variable_sp->GetScope())
- {
- case eValueTypeVariableGlobal:
- case eValueTypeVariableStatic:
- case eValueTypeVariableThreadLocal:
- add_variable = statics;
- break;
-
- case eValueTypeVariableArgument:
- add_variable = arguments;
- break;
-
- case eValueTypeVariableLocal:
- add_variable = locals;
- break;
-
- default:
- break;
- }
- if (add_variable)
- {
- if (target_sp)
- value_list.Append (ValueObjectVariable::Create (target_sp.get(), variable_sp));
- }
- }
- }
+lldb::SBValueList SBBlock::GetVariables(lldb::SBTarget &target, bool arguments,
+ bool locals, bool statics) {
+ Block *block = GetPtr();
+
+ SBValueList value_list;
+ if (block) {
+ TargetSP target_sp(target.GetSP());
+
+ VariableListSP variable_list_sp(block->GetBlockVariableList(true));
+
+ if (variable_list_sp) {
+ const size_t num_variables = variable_list_sp->GetSize();
+ if (num_variables) {
+ for (size_t i = 0; i < num_variables; ++i) {
+ VariableSP variable_sp(variable_list_sp->GetVariableAtIndex(i));
+ if (variable_sp) {
+ bool add_variable = false;
+ switch (variable_sp->GetScope()) {
+ case eValueTypeVariableGlobal:
+ case eValueTypeVariableStatic:
+ case eValueTypeVariableThreadLocal:
+ add_variable = statics;
+ break;
+
+ case eValueTypeVariableArgument:
+ add_variable = arguments;
+ break;
+
+ case eValueTypeVariableLocal:
+ add_variable = locals;
+ break;
+
+ default:
+ break;
}
+ if (add_variable) {
+ if (target_sp)
+ value_list.Append(
+ ValueObjectVariable::Create(target_sp.get(), variable_sp));
+ }
+ }
}
- }
- return value_list;
+ }
+ }
+ }
+ return value_list;
}
-
diff --git a/source/API/SBBreakpoint.cpp b/source/API/SBBreakpoint.cpp
index ec3a3de4a788..0eab2c2a363f 100644
--- a/source/API/SBBreakpoint.cpp
+++ b/source/API/SBBreakpoint.cpp
@@ -21,6 +21,7 @@
#include "lldb/API/SBThread.h"
#include "lldb/Breakpoint/Breakpoint.h"
+#include "lldb/Breakpoint/BreakpointIDList.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Address.h"
@@ -38,753 +39,818 @@
#include "lldb/lldb-enumerations.h"
+#include "llvm/ADT/STLExtras.h"
+
using namespace lldb;
using namespace lldb_private;
-struct CallbackData
-{
- SBBreakpoint::BreakpointHitCallback callback;
- void *callback_baton;
+struct CallbackData {
+ SBBreakpoint::BreakpointHitCallback callback;
+ void *callback_baton;
};
-class SBBreakpointCallbackBaton : public Baton
-{
+class SBBreakpointCallbackBaton : public TypedBaton<CallbackData> {
public:
- SBBreakpointCallbackBaton (SBBreakpoint::BreakpointHitCallback callback, void *baton) :
- Baton (new CallbackData)
- {
- CallbackData *data = (CallbackData *)m_data;
- data->callback = callback;
- data->callback_baton = baton;
- }
-
- ~SBBreakpointCallbackBaton() override
- {
- CallbackData *data = (CallbackData *)m_data;
-
- if (data)
- {
- delete data;
- m_data = nullptr;
- }
- }
+ SBBreakpointCallbackBaton(SBBreakpoint::BreakpointHitCallback callback,
+ void *baton)
+ : TypedBaton(llvm::make_unique<CallbackData>()) {
+ getItem()->callback = callback;
+ getItem()->callback_baton = baton;
+ }
};
-SBBreakpoint::SBBreakpoint () :
- m_opaque_sp ()
-{
-}
+SBBreakpoint::SBBreakpoint() : m_opaque_sp() {}
-SBBreakpoint::SBBreakpoint (const SBBreakpoint& rhs) :
- m_opaque_sp (rhs.m_opaque_sp)
-{
-}
+SBBreakpoint::SBBreakpoint(const SBBreakpoint &rhs)
+ : m_opaque_sp(rhs.m_opaque_sp) {}
-SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp) :
- m_opaque_sp (bp_sp)
-{
-}
+SBBreakpoint::SBBreakpoint(const lldb::BreakpointSP &bp_sp)
+ : m_opaque_sp(bp_sp) {}
SBBreakpoint::~SBBreakpoint() = default;
-const SBBreakpoint &
-SBBreakpoint::operator = (const SBBreakpoint& rhs)
-{
- if (this != &rhs)
- m_opaque_sp = rhs.m_opaque_sp;
- return *this;
+const SBBreakpoint &SBBreakpoint::operator=(const SBBreakpoint &rhs) {
+ if (this != &rhs)
+ m_opaque_sp = rhs.m_opaque_sp;
+ return *this;
}
-bool
-SBBreakpoint::operator == (const lldb::SBBreakpoint& rhs)
-{
- if (m_opaque_sp && rhs.m_opaque_sp)
- return m_opaque_sp.get() == rhs.m_opaque_sp.get();
- return false;
+bool SBBreakpoint::operator==(const lldb::SBBreakpoint &rhs) {
+ if (m_opaque_sp && rhs.m_opaque_sp)
+ return m_opaque_sp.get() == rhs.m_opaque_sp.get();
+ return false;
}
-bool
-SBBreakpoint::operator != (const lldb::SBBreakpoint& rhs)
-{
- if (m_opaque_sp && rhs.m_opaque_sp)
- return m_opaque_sp.get() != rhs.m_opaque_sp.get();
- return (m_opaque_sp && !rhs.m_opaque_sp) || (rhs.m_opaque_sp && !m_opaque_sp);
+bool SBBreakpoint::operator!=(const lldb::SBBreakpoint &rhs) {
+ if (m_opaque_sp && rhs.m_opaque_sp)
+ return m_opaque_sp.get() != rhs.m_opaque_sp.get();
+ return (m_opaque_sp && !rhs.m_opaque_sp) || (rhs.m_opaque_sp && !m_opaque_sp);
}
-break_id_t
-SBBreakpoint::GetID () const
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+break_id_t SBBreakpoint::GetID() const {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- break_id_t break_id = LLDB_INVALID_BREAK_ID;
- if (m_opaque_sp)
- break_id = m_opaque_sp->GetID();
+ break_id_t break_id = LLDB_INVALID_BREAK_ID;
+ if (m_opaque_sp)
+ break_id = m_opaque_sp->GetID();
- if (log)
- {
- if (break_id == LLDB_INVALID_BREAK_ID)
- log->Printf ("SBBreakpoint(%p)::GetID () => LLDB_INVALID_BREAK_ID",
- static_cast<void*>(m_opaque_sp.get()));
- else
- log->Printf ("SBBreakpoint(%p)::GetID () => %u",
- static_cast<void*>(m_opaque_sp.get()), break_id);
- }
+ if (log) {
+ if (break_id == LLDB_INVALID_BREAK_ID)
+ log->Printf("SBBreakpoint(%p)::GetID () => LLDB_INVALID_BREAK_ID",
+ static_cast<void *>(m_opaque_sp.get()));
+ else
+ log->Printf("SBBreakpoint(%p)::GetID () => %u",
+ static_cast<void *>(m_opaque_sp.get()), break_id);
+ }
- return break_id;
+ return break_id;
}
-bool
-SBBreakpoint::IsValid() const
-{
- if (!m_opaque_sp)
- return false;
- else if (m_opaque_sp->GetTarget().GetBreakpointByID(m_opaque_sp->GetID()))
- return true;
- else
- return false;
+bool SBBreakpoint::IsValid() const {
+ if (!m_opaque_sp)
+ return false;
+ else if (m_opaque_sp->GetTarget().GetBreakpointByID(m_opaque_sp->GetID()))
+ return true;
+ else
+ return false;
}
-void
-SBBreakpoint::ClearAllBreakpointSites ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->ClearAllBreakpointSites ();
- }
+void SBBreakpoint::ClearAllBreakpointSites() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->ClearAllBreakpointSites();
+ }
}
-SBBreakpointLocation
-SBBreakpoint::FindLocationByAddress (addr_t vm_addr)
-{
- SBBreakpointLocation sb_bp_location;
-
- if (m_opaque_sp)
- {
- if (vm_addr != LLDB_INVALID_ADDRESS)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- Address address;
- Target &target = m_opaque_sp->GetTarget();
- if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address))
- {
- address.SetRawAddress (vm_addr);
- }
- sb_bp_location.SetLocation (m_opaque_sp->FindLocationByAddress (address));
- }
- }
- return sb_bp_location;
-}
-
-break_id_t
-SBBreakpoint::FindLocationIDByAddress (addr_t vm_addr)
-{
- break_id_t break_id = LLDB_INVALID_BREAK_ID;
-
- if (m_opaque_sp && vm_addr != LLDB_INVALID_ADDRESS)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- Address address;
- Target &target = m_opaque_sp->GetTarget();
- if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address))
- {
- address.SetRawAddress (vm_addr);
- }
- break_id = m_opaque_sp->FindLocationIDByAddress (address);
- }
-
- return break_id;
-}
+SBBreakpointLocation SBBreakpoint::FindLocationByAddress(addr_t vm_addr) {
+ SBBreakpointLocation sb_bp_location;
-SBBreakpointLocation
-SBBreakpoint::FindLocationByID (break_id_t bp_loc_id)
-{
- SBBreakpointLocation sb_bp_location;
-
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- sb_bp_location.SetLocation (m_opaque_sp->FindLocationByID (bp_loc_id));
+ if (m_opaque_sp) {
+ if (vm_addr != LLDB_INVALID_ADDRESS) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ Address address;
+ Target &target = m_opaque_sp->GetTarget();
+ if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address)) {
+ address.SetRawAddress(vm_addr);
+ }
+ sb_bp_location.SetLocation(m_opaque_sp->FindLocationByAddress(address));
}
-
- return sb_bp_location;
+ }
+ return sb_bp_location;
}
-SBBreakpointLocation
-SBBreakpoint::GetLocationAtIndex (uint32_t index)
-{
- SBBreakpointLocation sb_bp_location;
-
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- sb_bp_location.SetLocation (m_opaque_sp->GetLocationAtIndex (index));
+break_id_t SBBreakpoint::FindLocationIDByAddress(addr_t vm_addr) {
+ break_id_t break_id = LLDB_INVALID_BREAK_ID;
+
+ if (m_opaque_sp && vm_addr != LLDB_INVALID_ADDRESS) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ Address address;
+ Target &target = m_opaque_sp->GetTarget();
+ if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address)) {
+ address.SetRawAddress(vm_addr);
}
+ break_id = m_opaque_sp->FindLocationIDByAddress(address);
+ }
- return sb_bp_location;
+ return break_id;
}
-void
-SBBreakpoint::SetEnabled (bool enable)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetEnabled (enabled=%i)",
- static_cast<void*>(m_opaque_sp.get()), enable);
+SBBreakpointLocation SBBreakpoint::FindLocationByID(break_id_t bp_loc_id) {
+ SBBreakpointLocation sb_bp_location;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetEnabled (enable);
- }
-}
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ sb_bp_location.SetLocation(m_opaque_sp->FindLocationByID(bp_loc_id));
+ }
-bool
-SBBreakpoint::IsEnabled ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->IsEnabled();
- }
- else
- return false;
+ return sb_bp_location;
}
-void
-SBBreakpoint::SetOneShot (bool one_shot)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBBreakpointLocation SBBreakpoint::GetLocationAtIndex(uint32_t index) {
+ SBBreakpointLocation sb_bp_location;
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetOneShot (one_shot=%i)",
- static_cast<void*>(m_opaque_sp.get()), one_shot);
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ sb_bp_location.SetLocation(m_opaque_sp->GetLocationAtIndex(index));
+ }
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetOneShot (one_shot);
- }
+ return sb_bp_location;
}
-bool
-SBBreakpoint::IsOneShot () const
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->IsOneShot();
- }
- else
- return false;
+void SBBreakpoint::SetEnabled(bool enable) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetEnabled (enabled=%i)",
+ static_cast<void *>(m_opaque_sp.get()), enable);
+
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetEnabled(enable);
+ }
}
-bool
-SBBreakpoint::IsInternal ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->IsInternal();
- }
- else
- return false;
+bool SBBreakpoint::IsEnabled() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->IsEnabled();
+ } else
+ return false;
}
-void
-SBBreakpoint::SetIgnoreCount (uint32_t count)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBBreakpoint::SetOneShot(bool one_shot) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetIgnoreCount (count=%u)",
- static_cast<void*>(m_opaque_sp.get()), count);
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetOneShot (one_shot=%i)",
+ static_cast<void *>(m_opaque_sp.get()), one_shot);
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetIgnoreCount (count);
- }
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetOneShot(one_shot);
+ }
}
-void
-SBBreakpoint::SetCondition (const char *condition)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetCondition (condition);
- }
+bool SBBreakpoint::IsOneShot() const {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->IsOneShot();
+ } else
+ return false;
}
-const char *
-SBBreakpoint::GetCondition ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->GetConditionText ();
- }
- return nullptr;
+bool SBBreakpoint::IsInternal() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->IsInternal();
+ } else
+ return false;
}
-uint32_t
-SBBreakpoint::GetHitCount () const
-{
- uint32_t count = 0;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- count = m_opaque_sp->GetHitCount();
- }
+void SBBreakpoint::SetIgnoreCount(uint32_t count) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetIgnoreCount (count=%u)",
+ static_cast<void *>(m_opaque_sp.get()), count);
+
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetIgnoreCount(count);
+ }
+}
+
+void SBBreakpoint::SetCondition(const char *condition) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetCondition(condition);
+ }
+}
+
+const char *SBBreakpoint::GetCondition() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetConditionText();
+ }
+ return nullptr;
+}
+
+uint32_t SBBreakpoint::GetHitCount() const {
+ uint32_t count = 0;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ count = m_opaque_sp->GetHitCount();
+ }
+
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetHitCount () => %u",
+ static_cast<void *>(m_opaque_sp.get()), count);
+
+ return count;
+}
+
+uint32_t SBBreakpoint::GetIgnoreCount() const {
+ uint32_t count = 0;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ count = m_opaque_sp->GetIgnoreCount();
+ }
+
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetIgnoreCount () => %u",
+ static_cast<void *>(m_opaque_sp.get()), count);
+
+ return count;
+}
+
+void SBBreakpoint::SetThreadID(tid_t tid) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetThreadID(tid);
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4" PRIx64 ")",
+ static_cast<void *>(m_opaque_sp.get()), tid);
+}
+
+tid_t SBBreakpoint::GetThreadID() {
+ tid_t tid = LLDB_INVALID_THREAD_ID;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ tid = m_opaque_sp->GetThreadID();
+ }
+
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetThreadID () => 0x%4.4" PRIx64,
+ static_cast<void *>(m_opaque_sp.get()), tid);
+ return tid;
+}
+
+void SBBreakpoint::SetThreadIndex(uint32_t index) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetThreadIndex (%u)",
+ static_cast<void *>(m_opaque_sp.get()), index);
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->GetOptions()->GetThreadSpec()->SetIndex(index);
+ }
+}
+
+uint32_t SBBreakpoint::GetThreadIndex() const {
+ uint32_t thread_idx = UINT32_MAX;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ const ThreadSpec *thread_spec =
+ m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
+ if (thread_spec != nullptr)
+ thread_idx = thread_spec->GetIndex();
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetThreadIndex () => %u",
+ static_cast<void *>(m_opaque_sp.get()), thread_idx);
+
+ return thread_idx;
+}
+
+void SBBreakpoint::SetThreadName(const char *thread_name) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetThreadName (%s)",
+ static_cast<void *>(m_opaque_sp.get()), thread_name);
+
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->GetOptions()->GetThreadSpec()->SetName(thread_name);
+ }
+}
+
+const char *SBBreakpoint::GetThreadName() const {
+ const char *name = nullptr;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ const ThreadSpec *thread_spec =
+ m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
+ if (thread_spec != nullptr)
+ name = thread_spec->GetName();
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetThreadName () => %s",
+ static_cast<void *>(m_opaque_sp.get()), name);
+
+ return name;
+}
+
+void SBBreakpoint::SetQueueName(const char *queue_name) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetQueueName (%s)",
+ static_cast<void *>(m_opaque_sp.get()), queue_name);
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->GetOptions()->GetThreadSpec()->SetQueueName(queue_name);
+ }
+}
+
+const char *SBBreakpoint::GetQueueName() const {
+ const char *name = nullptr;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ const ThreadSpec *thread_spec =
+ m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
+ if (thread_spec)
+ name = thread_spec->GetQueueName();
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetQueueName () => %s",
+ static_cast<void *>(m_opaque_sp.get()), name);
+
+ return name;
+}
+
+size_t SBBreakpoint::GetNumResolvedLocations() const {
+ size_t num_resolved = 0;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ num_resolved = m_opaque_sp->GetNumResolvedLocations();
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetNumResolvedLocations () => %" PRIu64,
+ static_cast<void *>(m_opaque_sp.get()),
+ static_cast<uint64_t>(num_resolved));
+ return num_resolved;
+}
+
+size_t SBBreakpoint::GetNumLocations() const {
+ size_t num_locs = 0;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ num_locs = m_opaque_sp->GetNumLocations();
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetNumLocations () => %" PRIu64,
+ static_cast<void *>(m_opaque_sp.get()),
+ static_cast<uint64_t>(num_locs));
+ return num_locs;
+}
+
+void SBBreakpoint::SetCommandLineCommands(SBStringList &commands) {
+ if (!m_opaque_sp)
+ return;
+ if (commands.GetSize() == 0)
+ return;
+
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ std::unique_ptr<BreakpointOptions::CommandData> cmd_data_up(
+ new BreakpointOptions::CommandData(*commands, eScriptLanguageNone));
+
+ m_opaque_sp->GetOptions()->SetCommandDataCallback(cmd_data_up);
+}
+
+bool SBBreakpoint::GetCommandLineCommands(SBStringList &commands) {
+ if (!m_opaque_sp)
+ return false;
+ StringList command_list;
+ bool has_commands =
+ m_opaque_sp->GetOptions()->GetCommandLineCallbacks(command_list);
+ if (has_commands)
+ commands.AppendList(command_list);
+ return has_commands;
+}
+
+bool SBBreakpoint::GetDescription(SBStream &s) {
+ return GetDescription(s, true);
+}
+
+bool SBBreakpoint::GetDescription(SBStream &s, bool include_locations) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ s.Printf("SBBreakpoint: id = %i, ", m_opaque_sp->GetID());
+ m_opaque_sp->GetResolverDescription(s.get());
+ m_opaque_sp->GetFilterDescription(s.get());
+ if (include_locations) {
+ const size_t num_locations = m_opaque_sp->GetNumLocations();
+ s.Printf(", locations = %" PRIu64, (uint64_t)num_locations);
+ }
+ return true;
+ }
+ s.Printf("No value");
+ return false;
+}
+
+bool SBBreakpoint::PrivateBreakpointHitCallback(void *baton,
+ StoppointCallbackContext *ctx,
+ lldb::user_id_t break_id,
+ lldb::user_id_t break_loc_id) {
+ ExecutionContext exe_ctx(ctx->exe_ctx_ref);
+ BreakpointSP bp_sp(
+ exe_ctx.GetTargetRef().GetBreakpointList().FindBreakpointByID(break_id));
+ if (baton && bp_sp) {
+ CallbackData *data = (CallbackData *)baton;
+ lldb_private::Breakpoint *bp = bp_sp.get();
+ if (bp && data->callback) {
+ Process *process = exe_ctx.GetProcessPtr();
+ if (process) {
+ SBProcess sb_process(process->shared_from_this());
+ SBThread sb_thread;
+ SBBreakpointLocation sb_location;
+ assert(bp_sp);
+ sb_location.SetLocation(bp_sp->FindLocationByID(break_loc_id));
+ Thread *thread = exe_ctx.GetThreadPtr();
+ if (thread)
+ sb_thread.SetThread(thread->shared_from_this());
+
+ return data->callback(data->callback_baton, sb_process, sb_thread,
+ sb_location);
+ }
+ }
+ }
+ return true; // Return true if we should stop at this breakpoint
+}
+
+void SBBreakpoint::SetCallback(BreakpointHitCallback callback, void *baton) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log) {
+ void *pointer = &callback;
+ log->Printf("SBBreakpoint(%p)::SetCallback (callback=%p, baton=%p)",
+ static_cast<void *>(m_opaque_sp.get()),
+ *static_cast<void **>(&pointer), static_cast<void *>(baton));
+ }
+
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ BatonSP baton_sp(new SBBreakpointCallbackBaton(callback, baton));
+ m_opaque_sp->SetCallback(SBBreakpoint::PrivateBreakpointHitCallback,
+ baton_sp, false);
+ }
+}
+
+void SBBreakpoint::SetScriptCallbackFunction(
+ const char *callback_function_name) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetScriptCallbackFunction (callback=%s)",
+ static_cast<void *>(m_opaque_sp.get()), callback_function_name);
+
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ BreakpointOptions *bp_options = m_opaque_sp->GetOptions();
+ m_opaque_sp->GetTarget()
+ .GetDebugger()
+ .GetCommandInterpreter()
+ .GetScriptInterpreter()
+ ->SetBreakpointCommandCallbackFunction(bp_options,
+ callback_function_name);
+ }
+}
+
+SBError SBBreakpoint::SetScriptCallbackBody(const char *callback_body_text) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetScriptCallbackBody: callback body:\n%s)",
+ static_cast<void *>(m_opaque_sp.get()), callback_body_text);
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetHitCount () => %u",
- static_cast<void*>(m_opaque_sp.get()), count);
+ SBError sb_error;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ BreakpointOptions *bp_options = m_opaque_sp->GetOptions();
+ Error error =
+ m_opaque_sp->GetTarget()
+ .GetDebugger()
+ .GetCommandInterpreter()
+ .GetScriptInterpreter()
+ ->SetBreakpointCommandCallback(bp_options, callback_body_text);
+ sb_error.SetError(error);
+ } else
+ sb_error.SetErrorString("invalid breakpoint");
- return count;
+ return sb_error;
}
-uint32_t
-SBBreakpoint::GetIgnoreCount () const
-{
- uint32_t count = 0;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- count = m_opaque_sp->GetIgnoreCount();
- }
-
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetIgnoreCount () => %u",
- static_cast<void*>(m_opaque_sp.get()), count);
+bool SBBreakpoint::AddName(const char *new_name) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- return count;
-}
+ if (log)
+ log->Printf("SBBreakpoint(%p)::AddName (name=%s)",
+ static_cast<void *>(m_opaque_sp.get()), new_name);
-void
-SBBreakpoint::SetThreadID (tid_t tid)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetThreadID (tid);
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4" PRIx64 ")",
- static_cast<void*>(m_opaque_sp.get()), tid);
-}
-
-tid_t
-SBBreakpoint::GetThreadID ()
-{
- tid_t tid = LLDB_INVALID_THREAD_ID;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- tid = m_opaque_sp->GetThreadID();
- }
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ Error error; // Think I'm just going to swallow the error here, it's
+ // probably more annoying to have to provide it.
+ return m_opaque_sp->AddName(new_name, error);
+ }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetThreadID () => 0x%4.4" PRIx64,
- static_cast<void*>(m_opaque_sp.get()), tid);
- return tid;
-}
-
-void
-SBBreakpoint::SetThreadIndex (uint32_t index)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetThreadIndex (%u)",
- static_cast<void*>(m_opaque_sp.get()), index);
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->GetOptions()->GetThreadSpec()->SetIndex (index);
- }
+ return false;
}
-uint32_t
-SBBreakpoint::GetThreadIndex() const
-{
- uint32_t thread_idx = UINT32_MAX;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
- if (thread_spec != nullptr)
- thread_idx = thread_spec->GetIndex();
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetThreadIndex () => %u",
- static_cast<void*>(m_opaque_sp.get()), thread_idx);
-
- return thread_idx;
-}
-
-void
-SBBreakpoint::SetThreadName (const char *thread_name)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetThreadName (%s)",
- static_cast<void*>(m_opaque_sp.get()), thread_name);
-
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->GetOptions()->GetThreadSpec()->SetName (thread_name);
- }
-}
+void SBBreakpoint::RemoveName(const char *name_to_remove) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-const char *
-SBBreakpoint::GetThreadName () const
-{
- const char *name = nullptr;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
- if (thread_spec != nullptr)
- name = thread_spec->GetName();
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetThreadName () => %s",
- static_cast<void*>(m_opaque_sp.get()), name);
-
- return name;
-}
-
-void
-SBBreakpoint::SetQueueName (const char *queue_name)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetQueueName (%s)",
- static_cast<void*>(m_opaque_sp.get()), queue_name);
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->GetOptions()->GetThreadSpec()->SetQueueName (queue_name);
- }
-}
+ if (log)
+ log->Printf("SBBreakpoint(%p)::RemoveName (name=%s)",
+ static_cast<void *>(m_opaque_sp.get()), name_to_remove);
-const char *
-SBBreakpoint::GetQueueName () const
-{
- const char *name = nullptr;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpecNoCreate();
- if (thread_spec)
- name = thread_spec->GetQueueName();
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetQueueName () => %s",
- static_cast<void*>(m_opaque_sp.get()), name);
-
- return name;
-}
-
-size_t
-SBBreakpoint::GetNumResolvedLocations() const
-{
- size_t num_resolved = 0;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- num_resolved = m_opaque_sp->GetNumResolvedLocations();
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %" PRIu64,
- static_cast<void*>(m_opaque_sp.get()),
- static_cast<uint64_t>(num_resolved));
- return num_resolved;
-}
-
-size_t
-SBBreakpoint::GetNumLocations() const
-{
- size_t num_locs = 0;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- num_locs = m_opaque_sp->GetNumLocations();
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetNumLocations () => %" PRIu64,
- static_cast<void*>(m_opaque_sp.get()),
- static_cast<uint64_t>(num_locs));
- return num_locs;
-}
-
-bool
-SBBreakpoint::GetDescription (SBStream &s)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- s.Printf("SBBreakpoint: id = %i, ", m_opaque_sp->GetID());
- m_opaque_sp->GetResolverDescription (s.get());
- m_opaque_sp->GetFilterDescription (s.get());
- const size_t num_locations = m_opaque_sp->GetNumLocations ();
- s.Printf(", locations = %" PRIu64, (uint64_t)num_locations);
- return true;
- }
- s.Printf ("No value");
- return false;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->RemoveName(name_to_remove);
+ }
}
-bool
-SBBreakpoint::PrivateBreakpointHitCallback(void *baton,
- StoppointCallbackContext *ctx,
- lldb::user_id_t break_id,
- lldb::user_id_t break_loc_id)
-{
- ExecutionContext exe_ctx (ctx->exe_ctx_ref);
- BreakpointSP bp_sp(exe_ctx.GetTargetRef().GetBreakpointList().FindBreakpointByID(break_id));
- if (baton && bp_sp)
- {
- CallbackData *data = (CallbackData *)baton;
- lldb_private::Breakpoint *bp = bp_sp.get();
- if (bp && data->callback)
- {
- Process *process = exe_ctx.GetProcessPtr();
- if (process)
- {
- SBProcess sb_process (process->shared_from_this());
- SBThread sb_thread;
- SBBreakpointLocation sb_location;
- assert (bp_sp);
- sb_location.SetLocation (bp_sp->FindLocationByID (break_loc_id));
- Thread *thread = exe_ctx.GetThreadPtr();
- if (thread)
- sb_thread.SetThread(thread->shared_from_this());
-
- return data->callback (data->callback_baton,
- sb_process,
- sb_thread,
- sb_location);
- }
- }
- }
- return true; // Return true if we should stop at this breakpoint
-}
+bool SBBreakpoint::MatchesName(const char *name) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-void
-SBBreakpoint::SetCallback (BreakpointHitCallback callback, void *baton)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBreakpoint(%p)::MatchesName (name=%s)",
+ static_cast<void *>(m_opaque_sp.get()), name);
- if (log)
- {
- void *pointer = &callback;
- log->Printf ("SBBreakpoint(%p)::SetCallback (callback=%p, baton=%p)",
- static_cast<void*>(m_opaque_sp.get()),
- *static_cast<void**>(&pointer), static_cast<void*>(baton));
- }
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->MatchesName(name);
+ }
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- BatonSP baton_sp(new SBBreakpointCallbackBaton (callback, baton));
- m_opaque_sp->SetCallback (SBBreakpoint::PrivateBreakpointHitCallback, baton_sp, false);
- }
+ return false;
}
-void
-SBBreakpoint::SetScriptCallbackFunction (const char *callback_function_name)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBBreakpoint::GetNames(SBStringList &names) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetScriptCallbackFunction (callback=%s)",
- static_cast<void*>(m_opaque_sp.get()),
- callback_function_name);
+ if (log)
+ log->Printf("SBBreakpoint(%p)::GetNames ()",
+ static_cast<void *>(m_opaque_sp.get()));
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- BreakpointOptions *bp_options = m_opaque_sp->GetOptions();
- m_opaque_sp->GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter()->SetBreakpointCommandCallbackFunction (bp_options,
- callback_function_name);
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ std::vector<std::string> names_vec;
+ m_opaque_sp->GetNames(names_vec);
+ for (std::string name : names_vec) {
+ names.AppendString(name.c_str());
}
+ }
}
-SBError
-SBBreakpoint::SetScriptCallbackBody (const char *callback_body_text)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetScriptCallbackBody: callback body:\n%s)",
- static_cast<void*>(m_opaque_sp.get()), callback_body_text);
-
- SBError sb_error;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- BreakpointOptions *bp_options = m_opaque_sp->GetOptions();
- Error error = m_opaque_sp->GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
- callback_body_text);
- sb_error.SetError(error);
- }
- else
- sb_error.SetErrorString("invalid breakpoint");
-
- return sb_error;
+lldb_private::Breakpoint *SBBreakpoint::operator->() const {
+ return m_opaque_sp.get();
}
-bool
-SBBreakpoint::AddName (const char *new_name)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBBreakpoint(%p)::AddName (name=%s)",
- static_cast<void*>(m_opaque_sp.get()),
- new_name);
+lldb_private::Breakpoint *SBBreakpoint::get() const {
+ return m_opaque_sp.get();
+}
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- Error error; // Think I'm just going to swallow the error here, it's probably more annoying to have to provide it.
- return m_opaque_sp->AddName(new_name, error);
- }
+lldb::BreakpointSP &SBBreakpoint::operator*() { return m_opaque_sp; }
- return false;
+const lldb::BreakpointSP &SBBreakpoint::operator*() const {
+ return m_opaque_sp;
}
-void
-SBBreakpoint::RemoveName (const char *name_to_remove)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+bool SBBreakpoint::EventIsBreakpointEvent(const lldb::SBEvent &event) {
+ return Breakpoint::BreakpointEventData::GetEventDataFromEvent(event.get()) !=
+ nullptr;
+}
- if (log)
- log->Printf ("SBBreakpoint(%p)::RemoveName (name=%s)",
- static_cast<void*>(m_opaque_sp.get()),
- name_to_remove);
+BreakpointEventType
+SBBreakpoint::GetBreakpointEventTypeFromEvent(const SBEvent &event) {
+ if (event.IsValid())
+ return Breakpoint::BreakpointEventData::GetBreakpointEventTypeFromEvent(
+ event.GetSP());
+ return eBreakpointEventTypeInvalidType;
+}
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->RemoveName(name_to_remove);
- }
+SBBreakpoint SBBreakpoint::GetBreakpointFromEvent(const lldb::SBEvent &event) {
+ SBBreakpoint sb_breakpoint;
+ if (event.IsValid())
+ sb_breakpoint.m_opaque_sp =
+ Breakpoint::BreakpointEventData::GetBreakpointFromEvent(event.GetSP());
+ return sb_breakpoint;
}
-bool
-SBBreakpoint::MatchesName (const char *name)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBBreakpointLocation
+SBBreakpoint::GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event,
+ uint32_t loc_idx) {
+ SBBreakpointLocation sb_breakpoint_loc;
+ if (event.IsValid())
+ sb_breakpoint_loc.SetLocation(
+ Breakpoint::BreakpointEventData::GetBreakpointLocationAtIndexFromEvent(
+ event.GetSP(), loc_idx));
+ return sb_breakpoint_loc;
+}
- if (log)
- log->Printf ("SBBreakpoint(%p)::MatchesName (name=%s)",
- static_cast<void*>(m_opaque_sp.get()),
- name);
+uint32_t
+SBBreakpoint::GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event) {
+ uint32_t num_locations = 0;
+ if (event.IsValid())
+ num_locations =
+ (Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent(
+ event.GetSP()));
+ return num_locations;
+}
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->MatchesName(name);
- }
+// This is simple collection of breakpoint id's and their target.
+class SBBreakpointListImpl {
+public:
+ SBBreakpointListImpl(lldb::TargetSP target_sp) : m_target_wp() {
+ if (target_sp && target_sp->IsValid())
+ m_target_wp = target_sp;
+ }
+
+ ~SBBreakpointListImpl() = default;
+
+ size_t GetSize() { return m_break_ids.size(); }
+
+ BreakpointSP GetBreakpointAtIndex(size_t idx) {
+ if (idx >= m_break_ids.size())
+ return BreakpointSP();
+ TargetSP target_sp = m_target_wp.lock();
+ if (!target_sp)
+ return BreakpointSP();
+ lldb::break_id_t bp_id = m_break_ids[idx];
+ return target_sp->GetBreakpointList().FindBreakpointByID(bp_id);
+ }
+
+ BreakpointSP FindBreakpointByID(lldb::break_id_t desired_id) {
+ TargetSP target_sp = m_target_wp.lock();
+ if (!target_sp)
+ return BreakpointSP();
+
+ for (lldb::break_id_t &break_id : m_break_ids) {
+ if (break_id == desired_id)
+ return target_sp->GetBreakpointList().FindBreakpointByID(break_id);
+ }
+ return BreakpointSP();
+ }
+
+ bool Append(Breakpoint &bkpt) {
+ TargetSP target_sp = m_target_wp.lock();
+ if (!target_sp)
+ return false;
+ if (bkpt.GetTargetSP() != target_sp)
+ return false;
+ m_break_ids.push_back(bkpt.GetID());
+ return true;
+ }
+
+ bool AppendIfUnique(Breakpoint &bkpt) {
+ TargetSP target_sp = m_target_wp.lock();
+ if (!target_sp)
+ return false;
+ if (bkpt.GetTargetSP() != target_sp)
+ return false;
+ lldb::break_id_t bp_id = bkpt.GetID();
+ if (find(m_break_ids.begin(), m_break_ids.end(), bp_id) ==
+ m_break_ids.end())
+ return false;
+
+ m_break_ids.push_back(bkpt.GetID());
+ return true;
+ }
+
+ bool AppendByID(lldb::break_id_t id) {
+ TargetSP target_sp = m_target_wp.lock();
+ if (!target_sp)
+ return false;
+ if (id == LLDB_INVALID_BREAK_ID)
+ return false;
+ m_break_ids.push_back(id);
+ return true;
+ }
+
+ void Clear() { m_break_ids.clear(); }
+
+ void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_list) {
+ for (lldb::break_id_t id : m_break_ids) {
+ bp_list.AddBreakpointID(BreakpointID(id));
+ }
+ }
+
+ TargetSP GetTarget() { return m_target_wp.lock(); }
+
+private:
+ std::vector<lldb::break_id_t> m_break_ids;
+ TargetWP m_target_wp;
+};
- return false;
-}
+SBBreakpointList::SBBreakpointList(SBTarget &target)
+ : m_opaque_sp(new SBBreakpointListImpl(target.GetSP())) {}
-void
-SBBreakpoint::GetNames (SBStringList &names)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBBreakpoint(%p)::GetNames ()",
- static_cast<void*>(m_opaque_sp.get()));
-
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- std::vector<std::string> names_vec;
- m_opaque_sp->GetNames(names_vec);
- for (std::string name : names_vec)
- {
- names.AppendString (name.c_str());
- }
- }
-}
+SBBreakpointList::~SBBreakpointList() {}
-lldb_private::Breakpoint *
-SBBreakpoint::operator->() const
-{
- return m_opaque_sp.get();
+size_t SBBreakpointList::GetSize() const {
+ if (!m_opaque_sp)
+ return 0;
+ else
+ return m_opaque_sp->GetSize();
}
-lldb_private::Breakpoint *
-SBBreakpoint::get() const
-{
- return m_opaque_sp.get();
-}
+SBBreakpoint SBBreakpointList::GetBreakpointAtIndex(size_t idx) {
+ if (!m_opaque_sp)
+ return SBBreakpoint();
-lldb::BreakpointSP &
-SBBreakpoint::operator *()
-{
- return m_opaque_sp;
+ BreakpointSP bkpt_sp = m_opaque_sp->GetBreakpointAtIndex(idx);
+ return SBBreakpoint(bkpt_sp);
}
-const lldb::BreakpointSP &
-SBBreakpoint::operator *() const
-{
- return m_opaque_sp;
+SBBreakpoint SBBreakpointList::FindBreakpointByID(lldb::break_id_t id) {
+ if (!m_opaque_sp)
+ return SBBreakpoint();
+ BreakpointSP bkpt_sp = m_opaque_sp->FindBreakpointByID(id);
+ return SBBreakpoint(bkpt_sp);
}
-bool
-SBBreakpoint::EventIsBreakpointEvent (const lldb::SBEvent &event)
-{
- return Breakpoint::BreakpointEventData::GetEventDataFromEvent(event.get()) != nullptr;
+void SBBreakpointList::Append(const SBBreakpoint &sb_bkpt) {
+ if (!sb_bkpt.IsValid())
+ return;
+ if (!m_opaque_sp)
+ return;
+ m_opaque_sp->Append(*sb_bkpt.get());
}
-BreakpointEventType
-SBBreakpoint::GetBreakpointEventTypeFromEvent (const SBEvent& event)
-{
- if (event.IsValid())
- return Breakpoint::BreakpointEventData::GetBreakpointEventTypeFromEvent (event.GetSP());
- return eBreakpointEventTypeInvalidType;
+void SBBreakpointList::AppendByID(lldb::break_id_t id) {
+ if (!m_opaque_sp)
+ return;
+ m_opaque_sp->AppendByID(id);
}
-SBBreakpoint
-SBBreakpoint::GetBreakpointFromEvent (const lldb::SBEvent& event)
-{
- SBBreakpoint sb_breakpoint;
- if (event.IsValid())
- sb_breakpoint.m_opaque_sp = Breakpoint::BreakpointEventData::GetBreakpointFromEvent (event.GetSP());
- return sb_breakpoint;
+bool SBBreakpointList::AppendIfUnique(const SBBreakpoint &sb_bkpt) {
+ if (!sb_bkpt.IsValid())
+ return false;
+ if (!m_opaque_sp)
+ return false;
+ return m_opaque_sp->AppendIfUnique(*sb_bkpt.get());
}
-SBBreakpointLocation
-SBBreakpoint::GetBreakpointLocationAtIndexFromEvent (const lldb::SBEvent& event, uint32_t loc_idx)
-{
- SBBreakpointLocation sb_breakpoint_loc;
- if (event.IsValid())
- sb_breakpoint_loc.SetLocation (Breakpoint::BreakpointEventData::GetBreakpointLocationAtIndexFromEvent (event.GetSP(), loc_idx));
- return sb_breakpoint_loc;
+void SBBreakpointList::Clear() {
+ if (m_opaque_sp)
+ m_opaque_sp->Clear();
}
-uint32_t
-SBBreakpoint::GetNumBreakpointLocationsFromEvent (const lldb::SBEvent &event)
-{
- uint32_t num_locations = 0;
- if (event.IsValid())
- num_locations = (Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent (event.GetSP()));
- return num_locations;
+void SBBreakpointList::CopyToBreakpointIDList(
+ lldb_private::BreakpointIDList &bp_id_list) {
+ if (m_opaque_sp)
+ m_opaque_sp->CopyToBreakpointIDList(bp_id_list);
}
diff --git a/source/API/SBBreakpointLocation.cpp b/source/API/SBBreakpointLocation.cpp
index 631a32bc9dda..c7fac7688f83 100644
--- a/source/API/SBBreakpointLocation.cpp
+++ b/source/API/SBBreakpointLocation.cpp
@@ -8,13 +8,11 @@
//===----------------------------------------------------------------------===//
#include "lldb/API/SBBreakpointLocation.h"
-#include "lldb/API/SBDefines.h"
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBDebugger.h"
+#include "lldb/API/SBDefines.h"
#include "lldb/API/SBStream.h"
-#include "lldb/lldb-types.h"
-#include "lldb/lldb-defines.h"
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Debugger.h"
@@ -23,347 +21,296 @@
#include "lldb/Core/StreamFile.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
-#include "lldb/Target/ThreadSpec.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/ThreadSpec.h"
+#include "lldb/Target/ThreadSpec.h"
+#include "lldb/lldb-defines.h"
+#include "lldb/lldb-types.h"
using namespace lldb;
using namespace lldb_private;
-
-SBBreakpointLocation::SBBreakpointLocation () :
- m_opaque_sp ()
-{
+SBBreakpointLocation::SBBreakpointLocation() : m_opaque_sp() {}
+
+SBBreakpointLocation::SBBreakpointLocation(
+ const lldb::BreakpointLocationSP &break_loc_sp)
+ : m_opaque_sp(break_loc_sp) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log) {
+ SBStream sstr;
+ GetDescription(sstr, lldb::eDescriptionLevelBrief);
+ log->Printf("SBBreakpointLocation::SBBreakpointLocaiton (const "
+ "lldb::BreakpointLocationsSP &break_loc_sp"
+ "=%p) => this.sp = %p (%s)",
+ static_cast<void *>(break_loc_sp.get()),
+ static_cast<void *>(m_opaque_sp.get()), sstr.GetData());
+ }
}
-SBBreakpointLocation::SBBreakpointLocation (const lldb::BreakpointLocationSP &break_loc_sp) :
- m_opaque_sp (break_loc_sp)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- {
- SBStream sstr;
- GetDescription (sstr, lldb::eDescriptionLevelBrief);
- log->Printf ("SBBreakpointLocation::SBBreakpointLocaiton (const lldb::BreakpointLocationsSP &break_loc_sp"
- "=%p) => this.sp = %p (%s)",
- static_cast<void*>(break_loc_sp.get()),
- static_cast<void*>(m_opaque_sp.get()), sstr.GetData());
- }
-}
+SBBreakpointLocation::SBBreakpointLocation(const SBBreakpointLocation &rhs)
+ : m_opaque_sp(rhs.m_opaque_sp) {}
-SBBreakpointLocation::SBBreakpointLocation(const SBBreakpointLocation &rhs) :
- m_opaque_sp (rhs.m_opaque_sp)
-{
+const SBBreakpointLocation &SBBreakpointLocation::
+operator=(const SBBreakpointLocation &rhs) {
+ if (this != &rhs)
+ m_opaque_sp = rhs.m_opaque_sp;
+ return *this;
}
-const SBBreakpointLocation &
-SBBreakpointLocation::operator = (const SBBreakpointLocation &rhs)
-{
- if (this != &rhs)
- m_opaque_sp = rhs.m_opaque_sp;
- return *this;
-}
+SBBreakpointLocation::~SBBreakpointLocation() {}
+bool SBBreakpointLocation::IsValid() const { return m_opaque_sp.get() != NULL; }
-SBBreakpointLocation::~SBBreakpointLocation ()
-{
+SBAddress SBBreakpointLocation::GetAddress() {
+ if (m_opaque_sp)
+ return SBAddress(&m_opaque_sp->GetAddress());
+ else
+ return SBAddress();
}
-bool
-SBBreakpointLocation::IsValid() const
-{
- return m_opaque_sp.get() != NULL;
-}
-
-SBAddress
-SBBreakpointLocation::GetAddress ()
-{
- if (m_opaque_sp)
- return SBAddress(&m_opaque_sp->GetAddress());
- else
- return SBAddress();
-}
+addr_t SBBreakpointLocation::GetLoadAddress() {
+ addr_t ret_addr = LLDB_INVALID_ADDRESS;
-addr_t
-SBBreakpointLocation::GetLoadAddress ()
-{
- addr_t ret_addr = LLDB_INVALID_ADDRESS;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ ret_addr = m_opaque_sp->GetLoadAddress();
+ }
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- ret_addr = m_opaque_sp->GetLoadAddress();
- }
-
- return ret_addr;
+ return ret_addr;
}
-void
-SBBreakpointLocation::SetEnabled (bool enabled)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetEnabled (enabled);
- }
+void SBBreakpointLocation::SetEnabled(bool enabled) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetEnabled(enabled);
+ }
}
-bool
-SBBreakpointLocation::IsEnabled ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->IsEnabled();
- }
- else
- return false;
+bool SBBreakpointLocation::IsEnabled() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->IsEnabled();
+ } else
+ return false;
}
-uint32_t
-SBBreakpointLocation::GetIgnoreCount ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->GetIgnoreCount();
- }
- else
- return 0;
+uint32_t SBBreakpointLocation::GetIgnoreCount() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetIgnoreCount();
+ } else
+ return 0;
}
-void
-SBBreakpointLocation::SetIgnoreCount (uint32_t n)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetIgnoreCount (n);
- }
+void SBBreakpointLocation::SetIgnoreCount(uint32_t n) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetIgnoreCount(n);
+ }
}
-void
-SBBreakpointLocation::SetCondition (const char *condition)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetCondition (condition);
- }
+void SBBreakpointLocation::SetCondition(const char *condition) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetCondition(condition);
+ }
}
-const char *
-SBBreakpointLocation::GetCondition ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->GetConditionText ();
- }
- return NULL;
+const char *SBBreakpointLocation::GetCondition() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetConditionText();
+ }
+ return NULL;
}
-void
-SBBreakpointLocation::SetScriptCallbackFunction (const char *callback_function_name)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBBreakpointLocation(%p)::SetScriptCallbackFunction (callback=%s)",
- static_cast<void*>(m_opaque_sp.get()),
- callback_function_name);
-
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- BreakpointOptions *bp_options = m_opaque_sp->GetLocationOptions();
- m_opaque_sp->GetBreakpoint().GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter()->SetBreakpointCommandCallbackFunction (bp_options,
- callback_function_name);
- }
+void SBBreakpointLocation::SetScriptCallbackFunction(
+ const char *callback_function_name) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log)
+ log->Printf(
+ "SBBreakpointLocation(%p)::SetScriptCallbackFunction (callback=%s)",
+ static_cast<void *>(m_opaque_sp.get()), callback_function_name);
+
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ BreakpointOptions *bp_options = m_opaque_sp->GetLocationOptions();
+ m_opaque_sp->GetBreakpoint()
+ .GetTarget()
+ .GetDebugger()
+ .GetCommandInterpreter()
+ .GetScriptInterpreter()
+ ->SetBreakpointCommandCallbackFunction(bp_options,
+ callback_function_name);
+ }
}
SBError
-SBBreakpointLocation::SetScriptCallbackBody (const char *callback_body_text)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBBreakpoint(%p)::SetScriptCallbackBody: callback body:\n%s)",
- static_cast<void*>(m_opaque_sp.get()), callback_body_text);
-
- SBError sb_error;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- BreakpointOptions *bp_options = m_opaque_sp->GetLocationOptions();
- Error error = m_opaque_sp->GetBreakpoint().GetTarget().GetDebugger().GetCommandInterpreter().GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
- callback_body_text);
- sb_error.SetError(error);
- }
- else
- sb_error.SetErrorString("invalid breakpoint");
-
- return sb_error;
+SBBreakpointLocation::SetScriptCallbackBody(const char *callback_body_text) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log)
+ log->Printf("SBBreakpoint(%p)::SetScriptCallbackBody: callback body:\n%s)",
+ static_cast<void *>(m_opaque_sp.get()), callback_body_text);
+
+ SBError sb_error;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ BreakpointOptions *bp_options = m_opaque_sp->GetLocationOptions();
+ Error error =
+ m_opaque_sp->GetBreakpoint()
+ .GetTarget()
+ .GetDebugger()
+ .GetCommandInterpreter()
+ .GetScriptInterpreter()
+ ->SetBreakpointCommandCallback(bp_options, callback_body_text);
+ sb_error.SetError(error);
+ } else
+ sb_error.SetErrorString("invalid breakpoint");
+
+ return sb_error;
}
-void
-SBBreakpointLocation::SetThreadID (tid_t thread_id)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetThreadID (thread_id);
- }
+void SBBreakpointLocation::SetThreadID(tid_t thread_id) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetThreadID(thread_id);
+ }
}
-tid_t
-SBBreakpointLocation::GetThreadID ()
-{
- tid_t tid = LLDB_INVALID_THREAD_ID;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->GetThreadID();
- }
- return tid;
+tid_t SBBreakpointLocation::GetThreadID() {
+ tid_t tid = LLDB_INVALID_THREAD_ID;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetThreadID();
+ }
+ return tid;
}
-void
-SBBreakpointLocation::SetThreadIndex (uint32_t index)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetThreadIndex (index);
- }
+void SBBreakpointLocation::SetThreadIndex(uint32_t index) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetThreadIndex(index);
+ }
}
-uint32_t
-SBBreakpointLocation::GetThreadIndex() const
-{
- uint32_t thread_idx = UINT32_MAX;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->GetThreadIndex();
- }
- return thread_idx;
-}
-
-
-void
-SBBreakpointLocation::SetThreadName (const char *thread_name)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetThreadName (thread_name);
- }
+uint32_t SBBreakpointLocation::GetThreadIndex() const {
+ uint32_t thread_idx = UINT32_MAX;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetThreadIndex();
+ }
+ return thread_idx;
}
-const char *
-SBBreakpointLocation::GetThreadName () const
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->GetThreadName();
- }
- return NULL;
+void SBBreakpointLocation::SetThreadName(const char *thread_name) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetThreadName(thread_name);
+ }
}
-void
-SBBreakpointLocation::SetQueueName (const char *queue_name)
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->SetQueueName (queue_name);
- }
+const char *SBBreakpointLocation::GetThreadName() const {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetThreadName();
+ }
+ return NULL;
}
-const char *
-SBBreakpointLocation::GetQueueName () const
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->GetQueueName ();
- }
- return NULL;
+void SBBreakpointLocation::SetQueueName(const char *queue_name) {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->SetQueueName(queue_name);
+ }
}
-bool
-SBBreakpointLocation::IsResolved ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->IsResolved();
- }
- return false;
+const char *SBBreakpointLocation::GetQueueName() const {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->GetQueueName();
+ }
+ return NULL;
}
-void
-SBBreakpointLocation::SetLocation (const lldb::BreakpointLocationSP &break_loc_sp)
-{
- // Uninstall the callbacks?
- m_opaque_sp = break_loc_sp;
+bool SBBreakpointLocation::IsResolved() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->IsResolved();
+ }
+ return false;
}
-bool
-SBBreakpointLocation::GetDescription (SBStream &description, DescriptionLevel level)
-{
- Stream &strm = description.ref();
-
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- m_opaque_sp->GetDescription (&strm, level);
- strm.EOL();
- }
- else
- strm.PutCString ("No value");
-
- return true;
+void SBBreakpointLocation::SetLocation(
+ const lldb::BreakpointLocationSP &break_loc_sp) {
+ // Uninstall the callbacks?
+ m_opaque_sp = break_loc_sp;
}
-break_id_t
-SBBreakpointLocation::GetID ()
-{
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- return m_opaque_sp->GetID ();
- }
- else
- return LLDB_INVALID_BREAK_ID;
+bool SBBreakpointLocation::GetDescription(SBStream &description,
+ DescriptionLevel level) {
+ Stream &strm = description.ref();
+
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ m_opaque_sp->GetDescription(&strm, level);
+ strm.EOL();
+ } else
+ strm.PutCString("No value");
+
+ return true;
}
-SBBreakpoint
-SBBreakpointLocation::GetBreakpoint ()
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- //if (log)
- // log->Printf ("SBBreakpointLocation::GetBreakpoint ()");
-
- SBBreakpoint sb_bp;
- if (m_opaque_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(m_opaque_sp->GetTarget().GetAPIMutex());
- *sb_bp = m_opaque_sp->GetBreakpoint ().shared_from_this();
- }
-
- if (log)
- {
- SBStream sstr;
- sb_bp.GetDescription (sstr);
- log->Printf ("SBBreakpointLocation(%p)::GetBreakpoint () => SBBreakpoint(%p) %s",
- static_cast<void*>(m_opaque_sp.get()),
- static_cast<void*>(sb_bp.get()), sstr.GetData());
- }
- return sb_bp;
+break_id_t SBBreakpointLocation::GetID() {
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ return m_opaque_sp->GetID();
+ } else
+ return LLDB_INVALID_BREAK_ID;
}
+SBBreakpoint SBBreakpointLocation::GetBreakpoint() {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ // if (log)
+ // log->Printf ("SBBreakpointLocation::GetBreakpoint ()");
+
+ SBBreakpoint sb_bp;
+ if (m_opaque_sp) {
+ std::lock_guard<std::recursive_mutex> guard(
+ m_opaque_sp->GetTarget().GetAPIMutex());
+ *sb_bp = m_opaque_sp->GetBreakpoint().shared_from_this();
+ }
+
+ if (log) {
+ SBStream sstr;
+ sb_bp.GetDescription(sstr);
+ log->Printf(
+ "SBBreakpointLocation(%p)::GetBreakpoint () => SBBreakpoint(%p) %s",
+ static_cast<void *>(m_opaque_sp.get()),
+ static_cast<void *>(sb_bp.get()), sstr.GetData());
+ }
+ return sb_bp;
+}
diff --git a/source/API/SBBroadcaster.cpp b/source/API/SBBroadcaster.cpp
index 4b751adc295f..5189dd7bb271 100644
--- a/source/API/SBBroadcaster.cpp
+++ b/source/API/SBBroadcaster.cpp
@@ -11,192 +11,151 @@
#include "lldb/Core/Log.h"
#include "lldb/API/SBBroadcaster.h"
-#include "lldb/API/SBListener.h"
#include "lldb/API/SBEvent.h"
+#include "lldb/API/SBListener.h"
using namespace lldb;
using namespace lldb_private;
+SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(NULL) {}
-SBBroadcaster::SBBroadcaster () :
- m_opaque_sp (),
- m_opaque_ptr (NULL)
-{
-}
-
-SBBroadcaster::SBBroadcaster (const char *name) :
- m_opaque_sp (new Broadcaster (NULL, name)),
- m_opaque_ptr (NULL)
-{
- m_opaque_ptr = m_opaque_sp.get();
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
+SBBroadcaster::SBBroadcaster(const char *name)
+ : m_opaque_sp(new Broadcaster(NULL, name)), m_opaque_ptr(NULL) {
+ m_opaque_ptr = m_opaque_sp.get();
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API |
+ LIBLLDB_LOG_VERBOSE));
- if (log)
- log->Printf ("SBBroadcaster::SBBroadcaster (name=\"%s\") => SBBroadcaster(%p)",
- name, static_cast<void*>(m_opaque_ptr));
+ if (log)
+ log->Printf(
+ "SBBroadcaster::SBBroadcaster (name=\"%s\") => SBBroadcaster(%p)", name,
+ static_cast<void *>(m_opaque_ptr));
}
-SBBroadcaster::SBBroadcaster (lldb_private::Broadcaster *broadcaster, bool owns) :
- m_opaque_sp (owns ? broadcaster : NULL),
- m_opaque_ptr (broadcaster)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE));
+SBBroadcaster::SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns)
+ : m_opaque_sp(owns ? broadcaster : NULL), m_opaque_ptr(broadcaster) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API |
+ LIBLLDB_LOG_VERBOSE));
- if (log)
- log->Printf ("SBBroadcaster::SBBroadcaster (broadcaster=%p, bool owns=%i) => SBBroadcaster(%p)",
- static_cast<void*>(broadcaster), owns,
- static_cast<void*>(m_opaque_ptr));
+ if (log)
+ log->Printf("SBBroadcaster::SBBroadcaster (broadcaster=%p, bool owns=%i) "
+ "=> SBBroadcaster(%p)",
+ static_cast<void *>(broadcaster), owns,
+ static_cast<void *>(m_opaque_ptr));
}
-SBBroadcaster::SBBroadcaster (const SBBroadcaster &rhs) :
- m_opaque_sp (rhs.m_opaque_sp),
- m_opaque_ptr (rhs.m_opaque_ptr)
-{
-}
+SBBroadcaster::SBBroadcaster(const SBBroadcaster &rhs)
+ : m_opaque_sp(rhs.m_opaque_sp), m_opaque_ptr(rhs.m_opaque_ptr) {}
-const SBBroadcaster &
-SBBroadcaster::operator = (const SBBroadcaster &rhs)
-{
- if (this != &rhs)
- {
- m_opaque_sp = rhs.m_opaque_sp;
- m_opaque_ptr = rhs.m_opaque_ptr;
- }
- return *this;
+const SBBroadcaster &SBBroadcaster::operator=(const SBBroadcaster &rhs) {
+ if (this != &rhs) {
+ m_opaque_sp = rhs.m_opaque_sp;
+ m_opaque_ptr = rhs.m_opaque_ptr;
+ }
+ return *this;
}
-SBBroadcaster::~SBBroadcaster()
-{
- reset (NULL, false);
-}
+SBBroadcaster::~SBBroadcaster() { reset(NULL, false); }
-void
-SBBroadcaster::BroadcastEventByType (uint32_t event_type, bool unique)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBBroadcaster::BroadcastEventByType(uint32_t event_type, bool unique) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, unique=%i)",
- static_cast<void*>(m_opaque_ptr), event_type, unique);
+ if (log)
+ log->Printf("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, "
+ "unique=%i)",
+ static_cast<void *>(m_opaque_ptr), event_type, unique);
- if (m_opaque_ptr == NULL)
- return;
+ if (m_opaque_ptr == NULL)
+ return;
- if (unique)
- m_opaque_ptr->BroadcastEventIfUnique (event_type);
- else
- m_opaque_ptr->BroadcastEvent (event_type);
+ if (unique)
+ m_opaque_ptr->BroadcastEventIfUnique(event_type);
+ else
+ m_opaque_ptr->BroadcastEvent(event_type);
}
-void
-SBBroadcaster::BroadcastEvent (const SBEvent &event, bool unique)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBBroadcaster::BroadcastEvent(const SBEvent &event, bool unique) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)",
- static_cast<void*>(m_opaque_ptr),
- static_cast<void*>(event.get()), unique);
+ if (log)
+ log->Printf(
+ "SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)",
+ static_cast<void *>(m_opaque_ptr), static_cast<void *>(event.get()),
+ unique);
- if (m_opaque_ptr == NULL)
- return;
+ if (m_opaque_ptr == NULL)
+ return;
- EventSP event_sp = event.GetSP ();
- if (unique)
- m_opaque_ptr->BroadcastEventIfUnique (event_sp);
- else
- m_opaque_ptr->BroadcastEvent (event_sp);
+ EventSP event_sp = event.GetSP();
+ if (unique)
+ m_opaque_ptr->BroadcastEventIfUnique(event_sp);
+ else
+ m_opaque_ptr->BroadcastEvent(event_sp);
}
-void
-SBBroadcaster::AddInitialEventsToListener (const SBListener &listener, uint32_t requested_events)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBBroadcaster(%p)::AddInitialEventsToListener (SBListener(%p), event_mask=0x%8.8x)",
- static_cast<void*>(m_opaque_ptr),
- static_cast<void*>(listener.get()), requested_events);
- if (m_opaque_ptr)
- m_opaque_ptr->AddInitialEventsToListener (listener.m_opaque_sp, requested_events);
+void SBBroadcaster::AddInitialEventsToListener(const SBListener &listener,
+ uint32_t requested_events) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBBroadcaster(%p)::AddInitialEventsToListener "
+ "(SBListener(%p), event_mask=0x%8.8x)",
+ static_cast<void *>(m_opaque_ptr),
+ static_cast<void *>(listener.get()), requested_events);
+ if (m_opaque_ptr)
+ m_opaque_ptr->AddInitialEventsToListener(listener.m_opaque_sp,
+ requested_events);
}
-uint32_t
-SBBroadcaster::AddListener (const SBListener &listener, uint32_t event_mask)
-{
- if (m_opaque_ptr)
- return m_opaque_ptr->AddListener (listener.m_opaque_sp, event_mask);
- return 0;
+uint32_t SBBroadcaster::AddListener(const SBListener &listener,
+ uint32_t event_mask) {
+ if (m_opaque_ptr)
+ return m_opaque_ptr->AddListener(listener.m_opaque_sp, event_mask);
+ return 0;
}
-const char *
-SBBroadcaster::GetName () const
-{
- if (m_opaque_ptr)
- return m_opaque_ptr->GetBroadcasterName().GetCString();
- return NULL;
+const char *SBBroadcaster::GetName() const {
+ if (m_opaque_ptr)
+ return m_opaque_ptr->GetBroadcasterName().GetCString();
+ return NULL;
}
-bool
-SBBroadcaster::EventTypeHasListeners (uint32_t event_type)
-{
- if (m_opaque_ptr)
- return m_opaque_ptr->EventTypeHasListeners (event_type);
- return false;
+bool SBBroadcaster::EventTypeHasListeners(uint32_t event_type) {
+ if (m_opaque_ptr)
+ return m_opaque_ptr->EventTypeHasListeners(event_type);
+ return false;
}
-bool
-SBBroadcaster::RemoveListener (const SBListener &listener, uint32_t event_mask)
-{
- if (m_opaque_ptr)
- return m_opaque_ptr->RemoveListener (listener.m_opaque_sp, event_mask);
- return false;
+bool SBBroadcaster::RemoveListener(const SBListener &listener,
+ uint32_t event_mask) {
+ if (m_opaque_ptr)
+ return m_opaque_ptr->RemoveListener(listener.m_opaque_sp, event_mask);
+ return false;
}
-Broadcaster *
-SBBroadcaster::get () const
-{
- return m_opaque_ptr;
-}
+Broadcaster *SBBroadcaster::get() const { return m_opaque_ptr; }
-void
-SBBroadcaster::reset (Broadcaster *broadcaster, bool owns)
-{
- if (owns)
- m_opaque_sp.reset (broadcaster);
- else
- m_opaque_sp.reset ();
- m_opaque_ptr = broadcaster;
+void SBBroadcaster::reset(Broadcaster *broadcaster, bool owns) {
+ if (owns)
+ m_opaque_sp.reset(broadcaster);
+ else
+ m_opaque_sp.reset();
+ m_opaque_ptr = broadcaster;
}
+bool SBBroadcaster::IsValid() const { return m_opaque_ptr != NULL; }
-bool
-SBBroadcaster::IsValid () const
-{
- return m_opaque_ptr != NULL;
-}
-
-void
-SBBroadcaster::Clear ()
-{
- m_opaque_sp.reset();
- m_opaque_ptr = NULL;
+void SBBroadcaster::Clear() {
+ m_opaque_sp.reset();
+ m_opaque_ptr = NULL;
}
-bool
-SBBroadcaster::operator == (const SBBroadcaster &rhs) const
-{
- return m_opaque_ptr == rhs.m_opaque_ptr;
-
+bool SBBroadcaster::operator==(const SBBroadcaster &rhs) const {
+ return m_opaque_ptr == rhs.m_opaque_ptr;
}
-bool
-SBBroadcaster::operator != (const SBBroadcaster &rhs) const
-{
- return m_opaque_ptr != rhs.m_opaque_ptr;
+bool SBBroadcaster::operator!=(const SBBroadcaster &rhs) const {
+ return m_opaque_ptr != rhs.m_opaque_ptr;
}
-bool
-SBBroadcaster::operator < (const SBBroadcaster &rhs) const
-{
- return m_opaque_ptr < rhs.m_opaque_ptr;
+bool SBBroadcaster::operator<(const SBBroadcaster &rhs) const {
+ return m_opaque_ptr < rhs.m_opaque_ptr;
}
diff --git a/source/API/SBCommandInterpreter.cpp b/source/API/SBCommandInterpreter.cpp
index dfa1709a3491..aa4953999b84 100644
--- a/source/API/SBCommandInterpreter.cpp
+++ b/source/API/SBCommandInterpreter.cpp
@@ -20,672 +20,597 @@
#include "lldb/Target/Target.h"
#include "lldb/API/SBBroadcaster.h"
-#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBCommandInterpreter.h"
+#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBExecutionContext.h"
-#include "lldb/API/SBProcess.h"
-#include "lldb/API/SBTarget.h"
#include "lldb/API/SBListener.h"
+#include "lldb/API/SBProcess.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
+#include "lldb/API/SBTarget.h"
using namespace lldb;
using namespace lldb_private;
-SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions()
-{
- m_opaque_up.reset(new CommandInterpreterRunOptions());
+SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions() {
+ m_opaque_up.reset(new CommandInterpreterRunOptions());
}
SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions() = default;
-bool
-SBCommandInterpreterRunOptions::GetStopOnContinue () const
-{
- return m_opaque_up->GetStopOnContinue();
+bool SBCommandInterpreterRunOptions::GetStopOnContinue() const {
+ return m_opaque_up->GetStopOnContinue();
}
-void
-SBCommandInterpreterRunOptions::SetStopOnContinue (bool stop_on_continue)
-{
- m_opaque_up->SetStopOnContinue(stop_on_continue);
+void SBCommandInterpreterRunOptions::SetStopOnContinue(bool stop_on_continue) {
+ m_opaque_up->SetStopOnContinue(stop_on_continue);
}
-bool
-SBCommandInterpreterRunOptions::GetStopOnError () const
-{
- return m_opaque_up->GetStopOnError();
+bool SBCommandInterpreterRunOptions::GetStopOnError() const {
+ return m_opaque_up->GetStopOnError();
}
-void
-SBCommandInterpreterRunOptions::SetStopOnError (bool stop_on_error)
-{
- m_opaque_up->SetStopOnError(stop_on_error);
+void SBCommandInterpreterRunOptions::SetStopOnError(bool stop_on_error) {
+ m_opaque_up->SetStopOnError(stop_on_error);
}
-bool
-SBCommandInterpreterRunOptions::GetStopOnCrash () const
-{
- return m_opaque_up->GetStopOnCrash();
+bool SBCommandInterpreterRunOptions::GetStopOnCrash() const {
+ return m_opaque_up->GetStopOnCrash();
}
-void
-SBCommandInterpreterRunOptions::SetStopOnCrash (bool stop_on_crash)
-{
- m_opaque_up->SetStopOnCrash(stop_on_crash);
+void SBCommandInterpreterRunOptions::SetStopOnCrash(bool stop_on_crash) {
+ m_opaque_up->SetStopOnCrash(stop_on_crash);
}
-bool
-SBCommandInterpreterRunOptions::GetEchoCommands () const
-{
- return m_opaque_up->GetEchoCommands();
+bool SBCommandInterpreterRunOptions::GetEchoCommands() const {
+ return m_opaque_up->GetEchoCommands();
}
-void
-SBCommandInterpreterRunOptions::SetEchoCommands (bool echo_commands)
-{
- m_opaque_up->SetEchoCommands(echo_commands);
+void SBCommandInterpreterRunOptions::SetEchoCommands(bool echo_commands) {
+ m_opaque_up->SetEchoCommands(echo_commands);
}
-bool
-SBCommandInterpreterRunOptions::GetPrintResults () const
-{
- return m_opaque_up->GetPrintResults();
+bool SBCommandInterpreterRunOptions::GetPrintResults() const {
+ return m_opaque_up->GetPrintResults();
}
-void
-SBCommandInterpreterRunOptions::SetPrintResults (bool print_results)
-{
- m_opaque_up->SetPrintResults(print_results);
+void SBCommandInterpreterRunOptions::SetPrintResults(bool print_results) {
+ m_opaque_up->SetPrintResults(print_results);
}
-bool
-SBCommandInterpreterRunOptions::GetAddToHistory () const
-{
- return m_opaque_up->GetAddToHistory();
+bool SBCommandInterpreterRunOptions::GetAddToHistory() const {
+ return m_opaque_up->GetAddToHistory();
}
-void
-SBCommandInterpreterRunOptions::SetAddToHistory (bool add_to_history)
-{
- m_opaque_up->SetAddToHistory(add_to_history);
+void SBCommandInterpreterRunOptions::SetAddToHistory(bool add_to_history) {
+ m_opaque_up->SetAddToHistory(add_to_history);
}
lldb_private::CommandInterpreterRunOptions *
-SBCommandInterpreterRunOptions::get () const
-{
- return m_opaque_up.get();
+SBCommandInterpreterRunOptions::get() const {
+ return m_opaque_up.get();
}
lldb_private::CommandInterpreterRunOptions &
-SBCommandInterpreterRunOptions::ref () const
-{
- return *m_opaque_up.get();
+SBCommandInterpreterRunOptions::ref() const {
+ return *m_opaque_up.get();
}
-class CommandPluginInterfaceImplementation : public CommandObjectParsed
-{
+class CommandPluginInterfaceImplementation : public CommandObjectParsed {
public:
- CommandPluginInterfaceImplementation(CommandInterpreter &interpreter,
- const char *name,
- lldb::SBCommandPluginInterface* backend,
- const char *help = nullptr,
- const char *syntax = nullptr,
- uint32_t flags = 0) :
- CommandObjectParsed (interpreter, name, help, syntax, flags),
- m_backend(backend) {}
-
- bool
- IsRemovable() const override
- {
- return true;
- }
-
+ CommandPluginInterfaceImplementation(CommandInterpreter &interpreter,
+ const char *name,
+ lldb::SBCommandPluginInterface *backend,
+ const char *help = nullptr,
+ const char *syntax = nullptr,
+ uint32_t flags = 0)
+ : CommandObjectParsed(interpreter, name, help, syntax, flags),
+ m_backend(backend) {}
+
+ bool IsRemovable() const override { return true; }
+
protected:
- bool
- DoExecute(Args& command, CommandReturnObject &result) override
- {
- SBCommandReturnObject sb_return(&result);
- SBCommandInterpreter sb_interpreter(&m_interpreter);
- SBDebugger debugger_sb(m_interpreter.GetDebugger().shared_from_this());
- bool ret = m_backend->DoExecute (debugger_sb,(char**)command.GetArgumentVector(), sb_return);
- sb_return.Release();
- return ret;
- }
- lldb::SBCommandPluginInterface* m_backend;
+ bool DoExecute(Args &command, CommandReturnObject &result) override {
+ SBCommandReturnObject sb_return(&result);
+ SBCommandInterpreter sb_interpreter(&m_interpreter);
+ SBDebugger debugger_sb(m_interpreter.GetDebugger().shared_from_this());
+ bool ret = m_backend->DoExecute(
+ debugger_sb, (char **)command.GetArgumentVector(), sb_return);
+ sb_return.Release();
+ return ret;
+ }
+ std::shared_ptr<lldb::SBCommandPluginInterface> m_backend;
};
-SBCommandInterpreter::SBCommandInterpreter (CommandInterpreter *interpreter) :
- m_opaque_ptr (interpreter)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBCommandInterpreter::SBCommandInterpreter(CommandInterpreter *interpreter)
+ : m_opaque_ptr(interpreter) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBCommandInterpreter::SBCommandInterpreter (interpreter=%p)"
- " => SBCommandInterpreter(%p)",
- static_cast<void*>(interpreter),
- static_cast<void*>(m_opaque_ptr));
+ if (log)
+ log->Printf("SBCommandInterpreter::SBCommandInterpreter (interpreter=%p)"
+ " => SBCommandInterpreter(%p)",
+ static_cast<void *>(interpreter),
+ static_cast<void *>(m_opaque_ptr));
}
-SBCommandInterpreter::SBCommandInterpreter(const SBCommandInterpreter &rhs) :
- m_opaque_ptr (rhs.m_opaque_ptr)
-{
-}
+SBCommandInterpreter::SBCommandInterpreter(const SBCommandInterpreter &rhs)
+ : m_opaque_ptr(rhs.m_opaque_ptr) {}
SBCommandInterpreter::~SBCommandInterpreter() = default;
-const SBCommandInterpreter &
-SBCommandInterpreter::operator = (const SBCommandInterpreter &rhs)
-{
- m_opaque_ptr = rhs.m_opaque_ptr;
- return *this;
+const SBCommandInterpreter &SBCommandInterpreter::
+operator=(const SBCommandInterpreter &rhs) {
+ m_opaque_ptr = rhs.m_opaque_ptr;
+ return *this;
}
-bool
-SBCommandInterpreter::IsValid() const
-{
- return m_opaque_ptr != nullptr;
-}
-
-bool
-SBCommandInterpreter::CommandExists(const char *cmd)
-{
- return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->CommandExists(cmd) : false);
-}
+bool SBCommandInterpreter::IsValid() const { return m_opaque_ptr != nullptr; }
-bool
-SBCommandInterpreter::AliasExists (const char *cmd)
-{
- return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->AliasExists(cmd) : false);
+bool SBCommandInterpreter::CommandExists(const char *cmd) {
+ return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->CommandExists(cmd)
+ : false);
}
-bool
-SBCommandInterpreter::IsActive()
-{
- return (IsValid() ? m_opaque_ptr->IsActive() : false);
+bool SBCommandInterpreter::AliasExists(const char *cmd) {
+ return (((cmd != nullptr) && IsValid()) ? m_opaque_ptr->AliasExists(cmd)
+ : false);
}
-const char *
-SBCommandInterpreter::GetIOHandlerControlSequence(char ch)
-{
- return (IsValid() ? m_opaque_ptr->GetDebugger().GetTopIOHandlerControlSequence(ch).GetCString() : nullptr);
+bool SBCommandInterpreter::IsActive() {
+ return (IsValid() ? m_opaque_ptr->IsActive() : false);
}
-lldb::ReturnStatus
-SBCommandInterpreter::HandleCommand (const char *command_line, SBCommandReturnObject &result, bool add_to_history)
-{
- SBExecutionContext sb_exe_ctx;
- return HandleCommand (command_line, sb_exe_ctx, result, add_to_history);
+const char *SBCommandInterpreter::GetIOHandlerControlSequence(char ch) {
+ return (IsValid()
+ ? m_opaque_ptr->GetDebugger()
+ .GetTopIOHandlerControlSequence(ch)
+ .GetCString()
+ : nullptr);
}
lldb::ReturnStatus
-SBCommandInterpreter::HandleCommand (const char *command_line, SBExecutionContext &override_context, SBCommandReturnObject &result, bool add_to_history)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", SBCommandReturnObject(%p), add_to_history=%i)",
- static_cast<void*>(m_opaque_ptr), command_line,
- static_cast<void*>(result.get()), add_to_history);
-
- ExecutionContext ctx, *ctx_ptr;
- if (override_context.get())
- {
- ctx = override_context.get()->Lock(true);
- ctx_ptr = &ctx;
+SBCommandInterpreter::HandleCommand(const char *command_line,
+ SBCommandReturnObject &result,
+ bool add_to_history) {
+ SBExecutionContext sb_exe_ctx;
+ return HandleCommand(command_line, sb_exe_ctx, result, add_to_history);
+}
+
+lldb::ReturnStatus SBCommandInterpreter::HandleCommand(
+ const char *command_line, SBExecutionContext &override_context,
+ SBCommandReturnObject &result, bool add_to_history) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log)
+ log->Printf("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", "
+ "SBCommandReturnObject(%p), add_to_history=%i)",
+ static_cast<void *>(m_opaque_ptr), command_line,
+ static_cast<void *>(result.get()), add_to_history);
+
+ ExecutionContext ctx, *ctx_ptr;
+ if (override_context.get()) {
+ ctx = override_context.get()->Lock(true);
+ ctx_ptr = &ctx;
+ } else
+ ctx_ptr = nullptr;
+
+ result.Clear();
+ if (command_line && IsValid()) {
+ result.ref().SetInteractive(false);
+ m_opaque_ptr->HandleCommand(command_line,
+ add_to_history ? eLazyBoolYes : eLazyBoolNo,
+ result.ref(), ctx_ptr);
+ } else {
+ result->AppendError(
+ "SBCommandInterpreter or the command line is not valid");
+ result->SetStatus(eReturnStatusFailed);
+ }
+
+ // We need to get the value again, in case the command disabled the log!
+ log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API);
+ if (log) {
+ SBStream sstr;
+ result.GetDescription(sstr);
+ log->Printf("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", "
+ "SBCommandReturnObject(%p): %s, add_to_history=%i) => %i",
+ static_cast<void *>(m_opaque_ptr), command_line,
+ static_cast<void *>(result.get()), sstr.GetData(),
+ add_to_history, result.GetStatus());
+ }
+
+ return result.GetStatus();
+}
+
+void SBCommandInterpreter::HandleCommandsFromFile(
+ lldb::SBFileSpec &file, lldb::SBExecutionContext &override_context,
+ lldb::SBCommandInterpreterRunOptions &options,
+ lldb::SBCommandReturnObject result) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log) {
+ SBStream s;
+ file.GetDescription(s);
+ log->Printf("SBCommandInterpreter(%p)::HandleCommandsFromFile "
+ "(file=\"%s\", SBCommandReturnObject(%p))",
+ static_cast<void *>(m_opaque_ptr), s.GetData(),
+ static_cast<void *>(result.get()));
+ }
+
+ if (!IsValid()) {
+ result->AppendError("SBCommandInterpreter is not valid.");
+ result->SetStatus(eReturnStatusFailed);
+ return;
+ }
+
+ if (!file.IsValid()) {
+ SBStream s;
+ file.GetDescription(s);
+ result->AppendErrorWithFormat("File is not valid: %s.", s.GetData());
+ result->SetStatus(eReturnStatusFailed);
+ }
+
+ FileSpec tmp_spec = file.ref();
+ ExecutionContext ctx, *ctx_ptr;
+ if (override_context.get()) {
+ ctx = override_context.get()->Lock(true);
+ ctx_ptr = &ctx;
+ } else
+ ctx_ptr = nullptr;
+
+ m_opaque_ptr->HandleCommandsFromFile(tmp_spec, ctx_ptr, options.ref(),
+ result.ref());
+}
+
+int SBCommandInterpreter::HandleCompletion(
+ const char *current_line, const char *cursor, const char *last_char,
+ int match_start_point, int max_return_elements, SBStringList &matches) {
+ 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.
+ if (current_line == nullptr || cursor == nullptr || last_char == nullptr)
+ return 0;
+
+ if (cursor < current_line || last_char < current_line)
+ return 0;
+
+ size_t current_line_size = strlen(current_line);
+ if (cursor - current_line > static_cast<ptrdiff_t>(current_line_size) ||
+ last_char - current_line > static_cast<ptrdiff_t>(current_line_size))
+ return 0;
+
+ if (log)
+ log->Printf("SBCommandInterpreter(%p)::HandleCompletion "
+ "(current_line=\"%s\", cursor at: %" PRId64
+ ", last char at: %" PRId64
+ ", match_start_point: %d, max_return_elements: %d)",
+ static_cast<void *>(m_opaque_ptr), current_line,
+ static_cast<uint64_t>(cursor - current_line),
+ static_cast<uint64_t>(last_char - current_line),
+ match_start_point, max_return_elements);
+
+ if (IsValid()) {
+ lldb_private::StringList lldb_matches;
+ num_completions = m_opaque_ptr->HandleCompletion(
+ current_line, cursor, last_char, match_start_point, max_return_elements,
+ lldb_matches);
+
+ SBStringList temp_list(&lldb_matches);
+ matches.AppendList(temp_list);
+ }
+ if (log)
+ log->Printf(
+ "SBCommandInterpreter(%p)::HandleCompletion - Found %d completions.",
+ static_cast<void *>(m_opaque_ptr), num_completions);
+
+ return num_completions;
+}
+
+int SBCommandInterpreter::HandleCompletion(const char *current_line,
+ uint32_t cursor_pos,
+ int match_start_point,
+ int max_return_elements,
+ lldb::SBStringList &matches) {
+ const char *cursor = current_line + cursor_pos;
+ const char *last_char = current_line + strlen(current_line);
+ return HandleCompletion(current_line, cursor, last_char, match_start_point,
+ max_return_elements, matches);
+}
+
+bool SBCommandInterpreter::HasCommands() {
+ return (IsValid() ? m_opaque_ptr->HasCommands() : false);
+}
+
+bool SBCommandInterpreter::HasAliases() {
+ return (IsValid() ? m_opaque_ptr->HasAliases() : false);
+}
+
+bool SBCommandInterpreter::HasAliasOptions() {
+ return (IsValid() ? m_opaque_ptr->HasAliasOptions() : false);
+}
+
+SBProcess SBCommandInterpreter::GetProcess() {
+ SBProcess sb_process;
+ ProcessSP process_sp;
+ if (IsValid()) {
+ TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
+ if (target_sp) {
+ std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
+ process_sp = target_sp->GetProcessSP();
+ sb_process.SetSP(process_sp);
}
- else
- ctx_ptr = nullptr;
-
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- result.Clear();
- if (command_line && IsValid())
- {
- result.ref().SetInteractive(false);
- m_opaque_ptr->HandleCommand (command_line, add_to_history ? eLazyBoolYes : eLazyBoolNo, result.ref(), ctx_ptr);
- }
- else
- {
- result->AppendError ("SBCommandInterpreter or the command line is not valid");
- result->SetStatus (eReturnStatusFailed);
- }
+ if (log)
+ log->Printf("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)",
+ static_cast<void *>(m_opaque_ptr),
+ static_cast<void *>(process_sp.get()));
- // We need to get the value again, in case the command disabled the log!
- log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
- if (log)
- {
- SBStream sstr;
- result.GetDescription (sstr);
- log->Printf ("SBCommandInterpreter(%p)::HandleCommand (command=\"%s\", SBCommandReturnObject(%p): %s, add_to_history=%i) => %i",
- static_cast<void*>(m_opaque_ptr), command_line,
- static_cast<void*>(result.get()), sstr.GetData(),
- add_to_history, result.GetStatus());
- }
-
- return result.GetStatus();
+ return sb_process;
}
-void
-SBCommandInterpreter::HandleCommandsFromFile (lldb::SBFileSpec &file,
- lldb::SBExecutionContext &override_context,
- lldb::SBCommandInterpreterRunOptions &options,
- lldb::SBCommandReturnObject result)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- {
- SBStream s;
- file.GetDescription (s);
- log->Printf ("SBCommandInterpreter(%p)::HandleCommandsFromFile (file=\"%s\", SBCommandReturnObject(%p))",
- static_cast<void*>(m_opaque_ptr), s.GetData(),
- static_cast<void*>(result.get()));
- }
-
- if (!IsValid())
- {
- result->AppendError ("SBCommandInterpreter is not valid.");
- result->SetStatus (eReturnStatusFailed);
- return;
- }
-
- if (!file.IsValid())
- {
- SBStream s;
- file.GetDescription (s);
- result->AppendErrorWithFormat ("File is not valid: %s.", s.GetData());
- result->SetStatus (eReturnStatusFailed);
- }
-
- FileSpec tmp_spec = file.ref();
- ExecutionContext ctx, *ctx_ptr;
- if (override_context.get())
- {
- ctx = override_context.get()->Lock(true);
- ctx_ptr = &ctx;
- }
- else
- ctx_ptr = nullptr;
-
- m_opaque_ptr->HandleCommandsFromFile (tmp_spec, ctx_ptr, options.ref(), result.ref());
-}
-
-int
-SBCommandInterpreter::HandleCompletion (const char *current_line,
- const char *cursor,
- const char *last_char,
- int match_start_point,
- int max_return_elements,
- SBStringList &matches)
-{
- 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.
- if (current_line == nullptr || cursor == nullptr || last_char == nullptr)
- return 0;
-
- if (cursor < current_line || last_char < current_line)
- return 0;
-
- size_t current_line_size = strlen (current_line);
- if (cursor - current_line > static_cast<ptrdiff_t>(current_line_size) ||
- last_char - current_line > static_cast<ptrdiff_t>(current_line_size))
- return 0;
-
- if (log)
- log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %" PRId64 ", last char at: %" PRId64 ", match_start_point: %d, max_return_elements: %d)",
- static_cast<void*>(m_opaque_ptr), current_line,
- static_cast<uint64_t>(cursor - current_line),
- static_cast<uint64_t>(last_char - current_line),
- match_start_point, max_return_elements);
-
- if (IsValid())
- {
- lldb_private::StringList lldb_matches;
- num_completions = m_opaque_ptr->HandleCompletion(current_line, cursor, last_char, match_start_point,
- max_return_elements, lldb_matches);
-
- SBStringList temp_list (&lldb_matches);
- matches.AppendList (temp_list);
- }
- if (log)
- log->Printf ("SBCommandInterpreter(%p)::HandleCompletion - Found %d completions.",
- static_cast<void*>(m_opaque_ptr), num_completions);
-
- return num_completions;
-}
-
-int
-SBCommandInterpreter::HandleCompletion (const char *current_line,
- uint32_t cursor_pos,
- int match_start_point,
- int max_return_elements,
- lldb::SBStringList &matches)
-{
- const char *cursor = current_line + cursor_pos;
- const char *last_char = current_line + strlen (current_line);
- return HandleCompletion (current_line, cursor, last_char, match_start_point, max_return_elements, matches);
-}
-
-bool
-SBCommandInterpreter::HasCommands()
-{
- return (IsValid() ? m_opaque_ptr->HasCommands() : false);
-}
-
-bool
-SBCommandInterpreter::HasAliases()
-{
- return (IsValid() ? m_opaque_ptr->HasAliases() : false);
-}
-
-bool
-SBCommandInterpreter::HasAliasOptions()
-{
- return (IsValid() ? m_opaque_ptr->HasAliasOptions() : false);
-}
-
-SBProcess
-SBCommandInterpreter::GetProcess ()
-{
- SBProcess sb_process;
- ProcessSP process_sp;
- if (IsValid())
- {
- TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
- if (target_sp)
- {
- std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
- process_sp = target_sp->GetProcessSP();
- sb_process.SetSP(process_sp);
- }
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBDebugger SBCommandInterpreter::GetDebugger() {
+ SBDebugger sb_debugger;
+ if (IsValid())
+ sb_debugger.reset(m_opaque_ptr->GetDebugger().shared_from_this());
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBCommandInterpreter(%p)::GetProcess () => SBProcess(%p)",
- static_cast<void*>(m_opaque_ptr),
- static_cast<void*>(process_sp.get()));
+ if (log)
+ log->Printf("SBCommandInterpreter(%p)::GetDebugger () => SBDebugger(%p)",
+ static_cast<void *>(m_opaque_ptr),
+ static_cast<void *>(sb_debugger.get()));
- return sb_process;
+ return sb_debugger;
}
-SBDebugger
-SBCommandInterpreter::GetDebugger ()
-{
- SBDebugger sb_debugger;
- if (IsValid())
- sb_debugger.reset(m_opaque_ptr->GetDebugger().shared_from_this());
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBCommandInterpreter(%p)::GetDebugger () => SBDebugger(%p)",
- static_cast<void*>(m_opaque_ptr),
- static_cast<void*>(sb_debugger.get()));
-
- return sb_debugger;
+bool SBCommandInterpreter::GetPromptOnQuit() {
+ return (IsValid() ? m_opaque_ptr->GetPromptOnQuit() : false);
}
-bool
-SBCommandInterpreter::GetPromptOnQuit()
-{
- return (IsValid() ? m_opaque_ptr->GetPromptOnQuit() : false);
+void SBCommandInterpreter::SetPromptOnQuit(bool b) {
+ if (IsValid())
+ m_opaque_ptr->SetPromptOnQuit(b);
}
-void
-SBCommandInterpreter::SetPromptOnQuit (bool b)
-{
- if (IsValid())
- m_opaque_ptr->SetPromptOnQuit(b);
+void SBCommandInterpreter::ResolveCommand(const char *command_line,
+ SBCommandReturnObject &result) {
+ result.Clear();
+ if (command_line && IsValid()) {
+ m_opaque_ptr->ResolveCommand(command_line, result.ref());
+ } else {
+ result->AppendError(
+ "SBCommandInterpreter or the command line is not valid");
+ result->SetStatus(eReturnStatusFailed);
+ }
}
-void
-SBCommandInterpreter::ResolveCommand(const char *command_line, SBCommandReturnObject &result)
-{
- result.Clear();
- if (command_line && IsValid())
- {
- m_opaque_ptr->ResolveCommand(command_line, result.ref());
- }
- else
- {
- result->AppendError("SBCommandInterpreter or the command line is not valid");
- result->SetStatus(eReturnStatusFailed);
- }
-}
+CommandInterpreter *SBCommandInterpreter::get() { return m_opaque_ptr; }
-CommandInterpreter *
-SBCommandInterpreter::get ()
-{
- return m_opaque_ptr;
+CommandInterpreter &SBCommandInterpreter::ref() {
+ assert(m_opaque_ptr);
+ return *m_opaque_ptr;
}
-CommandInterpreter &
-SBCommandInterpreter::ref ()
-{
- assert (m_opaque_ptr);
- return *m_opaque_ptr;
+void SBCommandInterpreter::reset(
+ lldb_private::CommandInterpreter *interpreter) {
+ m_opaque_ptr = interpreter;
}
-void
-SBCommandInterpreter::reset (lldb_private::CommandInterpreter *interpreter)
-{
- m_opaque_ptr = interpreter;
+void SBCommandInterpreter::SourceInitFileInHomeDirectory(
+ SBCommandReturnObject &result) {
+ result.Clear();
+ if (IsValid()) {
+ TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
+ std::unique_lock<std::recursive_mutex> lock;
+ if (target_sp)
+ lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+ m_opaque_ptr->SourceInitFile(false, result.ref());
+ } else {
+ result->AppendError("SBCommandInterpreter is not valid");
+ result->SetStatus(eReturnStatusFailed);
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ if (log)
+ log->Printf("SBCommandInterpreter(%p)::SourceInitFileInHomeDirectory "
+ "(&SBCommandReturnObject(%p))",
+ static_cast<void *>(m_opaque_ptr),
+ static_cast<void *>(result.get()));
}
-void
-SBCommandInterpreter::SourceInitFileInHomeDirectory (SBCommandReturnObject &result)
-{
- result.Clear();
- if (IsValid())
- {
- TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
- std::unique_lock<std::recursive_mutex> lock;
- if (target_sp)
- lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
- m_opaque_ptr->SourceInitFile (false, result.ref());
- }
- else
- {
- result->AppendError ("SBCommandInterpreter is not valid");
- result->SetStatus (eReturnStatusFailed);
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInHomeDirectory (&SBCommandReturnObject(%p))",
- static_cast<void*>(m_opaque_ptr),
- static_cast<void*>(result.get()));
-}
-
-void
-SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory (SBCommandReturnObject &result)
-{
- result.Clear();
- if (IsValid())
- {
- TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
- std::unique_lock<std::recursive_mutex> lock;
- if (target_sp)
- lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
- m_opaque_ptr->SourceInitFile (true, result.ref());
- }
- else
- {
- result->AppendError ("SBCommandInterpreter is not valid");
- result->SetStatus (eReturnStatusFailed);
- }
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+void SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory(
+ SBCommandReturnObject &result) {
+ result.Clear();
+ if (IsValid()) {
+ TargetSP target_sp(m_opaque_ptr->GetDebugger().GetSelectedTarget());
+ std::unique_lock<std::recursive_mutex> lock;
+ if (target_sp)
+ lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
+ m_opaque_ptr->SourceInitFile(true, result.ref());
+ } else {
+ result->AppendError("SBCommandInterpreter is not valid");
+ result->SetStatus(eReturnStatusFailed);
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBCommandInterpreter(%p)::SourceInitFileInCurrentWorkingDirectory (&SBCommandReturnObject(%p))",
- static_cast<void*>(m_opaque_ptr),
- static_cast<void*>(result.get()));
+ if (log)
+ log->Printf(
+ "SBCommandInterpreter(%p)::SourceInitFileInCurrentWorkingDirectory "
+ "(&SBCommandReturnObject(%p))",
+ static_cast<void *>(m_opaque_ptr), static_cast<void *>(result.get()));
}
-SBBroadcaster
-SBCommandInterpreter::GetBroadcaster ()
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+SBBroadcaster SBCommandInterpreter::GetBroadcaster() {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- SBBroadcaster broadcaster (m_opaque_ptr, false);
+ SBBroadcaster broadcaster(m_opaque_ptr, false);
- if (log)
- log->Printf ("SBCommandInterpreter(%p)::GetBroadcaster() => SBBroadcaster(%p)",
- static_cast<void*>(m_opaque_ptr), static_cast<void*>(broadcaster.get()));
+ if (log)
+ log->Printf(
+ "SBCommandInterpreter(%p)::GetBroadcaster() => SBBroadcaster(%p)",
+ static_cast<void *>(m_opaque_ptr),
+ static_cast<void *>(broadcaster.get()));
- return broadcaster;
+ return broadcaster;
}
-const char *
-SBCommandInterpreter::GetBroadcasterClass ()
-{
- return CommandInterpreter::GetStaticBroadcasterClass().AsCString();
+const char *SBCommandInterpreter::GetBroadcasterClass() {
+ return CommandInterpreter::GetStaticBroadcasterClass().AsCString();
}
-const char *
-SBCommandInterpreter::GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_type)
-{
- return CommandObject::GetArgumentTypeAsCString (arg_type);
+const char *SBCommandInterpreter::GetArgumentTypeAsCString(
+ const lldb::CommandArgumentType arg_type) {
+ return CommandObject::GetArgumentTypeAsCString(arg_type);
}
-const char *
-SBCommandInterpreter::GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type)
-{
- return CommandObject::GetArgumentDescriptionAsCString (arg_type);
+const char *SBCommandInterpreter::GetArgumentDescriptionAsCString(
+ const lldb::CommandArgumentType arg_type) {
+ return CommandObject::GetArgumentDescriptionAsCString(arg_type);
}
-
-bool
-SBCommandInterpreter::EventIsCommandInterpreterEvent (const lldb::SBEvent &event)
-{
- return event.GetBroadcasterClass() == SBCommandInterpreter::GetBroadcasterClass();
+
+bool SBCommandInterpreter::EventIsCommandInterpreterEvent(
+ const lldb::SBEvent &event) {
+ return event.GetBroadcasterClass() ==
+ SBCommandInterpreter::GetBroadcasterClass();
+}
+
+bool SBCommandInterpreter::SetCommandOverrideCallback(
+ const char *command_name, lldb::CommandOverrideCallback callback,
+ void *baton) {
+ if (command_name && command_name[0] && IsValid()) {
+ llvm::StringRef command_name_str = command_name;
+ CommandObject *cmd_obj =
+ m_opaque_ptr->GetCommandObjectForCommand(command_name_str);
+ if (cmd_obj) {
+ assert(command_name_str.empty());
+ cmd_obj->SetOverrideCallback(callback, baton);
+ return true;
+ }
+ }
+ return false;
}
-bool
-SBCommandInterpreter::SetCommandOverrideCallback (const char *command_name,
- lldb::CommandOverrideCallback callback,
- void *baton)
-{
- if (command_name && command_name[0] && IsValid())
- {
- std::string command_name_str (command_name);
- CommandObject *cmd_obj = m_opaque_ptr->GetCommandObjectForCommand(command_name_str);
- if (cmd_obj)
- {
- assert(command_name_str.empty());
- cmd_obj->SetOverrideCallback (callback, baton);
- return true;
- }
- }
- return false;
+lldb::SBCommand SBCommandInterpreter::AddMultiwordCommand(const char *name,
+ const char *help) {
+ CommandObjectMultiword *new_command =
+ new CommandObjectMultiword(*m_opaque_ptr, name, help);
+ new_command->SetRemovable(true);
+ lldb::CommandObjectSP new_command_sp(new_command);
+ if (new_command_sp &&
+ m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
+ return lldb::SBCommand(new_command_sp);
+ return lldb::SBCommand();
}
-lldb::SBCommand
-SBCommandInterpreter::AddMultiwordCommand (const char* name, const char* help)
-{
- CommandObjectMultiword *new_command = new CommandObjectMultiword(*m_opaque_ptr, name, help);
- new_command->SetRemovable (true);
- lldb::CommandObjectSP new_command_sp(new_command);
- if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
- return lldb::SBCommand(new_command_sp);
- return lldb::SBCommand();
+lldb::SBCommand SBCommandInterpreter::AddCommand(
+ const char *name, lldb::SBCommandPluginInterface *impl, const char *help) {
+ lldb::CommandObjectSP new_command_sp;
+ new_command_sp.reset(new CommandPluginInterfaceImplementation(
+ *m_opaque_ptr, name, impl, help));
+
+ if (new_command_sp &&
+ m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
+ return lldb::SBCommand(new_command_sp);
+ return lldb::SBCommand();
}
lldb::SBCommand
-SBCommandInterpreter::AddCommand (const char* name, lldb::SBCommandPluginInterface* impl, const char* help)
-{
- lldb::CommandObjectSP new_command_sp;
- new_command_sp.reset(new CommandPluginInterfaceImplementation(*m_opaque_ptr,name, impl, help));
+SBCommandInterpreter::AddCommand(const char *name,
+ lldb::SBCommandPluginInterface *impl,
+ const char *help, const char *syntax) {
+ lldb::CommandObjectSP new_command_sp;
+ new_command_sp.reset(new CommandPluginInterfaceImplementation(
+ *m_opaque_ptr, name, impl, help, syntax));
- if (new_command_sp && m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
- return lldb::SBCommand(new_command_sp);
- return lldb::SBCommand();
+ if (new_command_sp &&
+ m_opaque_ptr->AddUserCommand(name, new_command_sp, true))
+ return lldb::SBCommand(new_command_sp);
+ return lldb::SBCommand();
}
SBCommand::SBCommand() = default;
-SBCommand::SBCommand (lldb::CommandObjectSP cmd_sp) : m_opaque_sp (cmd_sp)
-{}
+SBCommand::SBCommand(lldb::CommandObjectSP cmd_sp) : m_opaque_sp(cmd_sp) {}
-bool
-SBCommand::IsValid()
-{
- return m_opaque_sp.get() != nullptr;
-}
+bool SBCommand::IsValid() { return m_opaque_sp.get() != nullptr; }
-const char*
-SBCommand::GetName()
-{
- return (IsValid() ? m_opaque_sp->GetCommandName() : nullptr);
+const char *SBCommand::GetName() {
+ return (IsValid() ? ConstString(m_opaque_sp->GetCommandName()).AsCString() : nullptr);
}
-const char*
-SBCommand::GetHelp()
-{
- return (IsValid() ? m_opaque_sp->GetHelp() : nullptr);
+const char *SBCommand::GetHelp() {
+ return (IsValid() ? ConstString(m_opaque_sp->GetHelp()).AsCString()
+ : nullptr);
}
-const char*
-SBCommand::GetHelpLong()
-{
- return (IsValid() ? m_opaque_sp->GetHelpLong() : nullptr);
+const char *SBCommand::GetHelpLong() {
+ return (IsValid() ? ConstString(m_opaque_sp->GetHelpLong()).AsCString()
+ : nullptr);
}
-void
-SBCommand::SetHelp (const char* help)
-{
- if (IsValid())
- m_opaque_sp->SetHelp(help);
+void SBCommand::SetHelp(const char *help) {
+ if (IsValid())
+ m_opaque_sp->SetHelp(help);
}
-void
-SBCommand::SetHelpLong (const char* help)
-{
- if (IsValid())
- m_opaque_sp->SetHelpLong(help);
+void SBCommand::SetHelpLong(const char *help) {
+ if (IsValid())
+ m_opaque_sp->SetHelpLong(help);
}
-lldb::SBCommand
-SBCommand::AddMultiwordCommand (const char* name, const char* help)
-{
- if (!IsValid ())
- return lldb::SBCommand();
- if (!m_opaque_sp->IsMultiwordObject())
- return lldb::SBCommand();
- CommandObjectMultiword *new_command = new CommandObjectMultiword(m_opaque_sp->GetCommandInterpreter(),name,help);
- new_command->SetRemovable (true);
- lldb::CommandObjectSP new_command_sp(new_command);
- if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
- return lldb::SBCommand(new_command_sp);
+lldb::SBCommand SBCommand::AddMultiwordCommand(const char *name,
+ const char *help) {
+ if (!IsValid())
return lldb::SBCommand();
-}
-
-lldb::SBCommand
-SBCommand::AddCommand (const char* name, lldb::SBCommandPluginInterface *impl, const char* help)
-{
- if (!IsValid ())
- return lldb::SBCommand();
- if (!m_opaque_sp->IsMultiwordObject())
- return lldb::SBCommand();
- lldb::CommandObjectSP new_command_sp;
- new_command_sp.reset(new CommandPluginInterfaceImplementation(m_opaque_sp->GetCommandInterpreter(),name,impl,help));
- if (new_command_sp && m_opaque_sp->LoadSubCommand(name,new_command_sp))
- return lldb::SBCommand(new_command_sp);
+ if (!m_opaque_sp->IsMultiwordObject())
+ return lldb::SBCommand();
+ CommandObjectMultiword *new_command = new CommandObjectMultiword(
+ m_opaque_sp->GetCommandInterpreter(), name, help);
+ new_command->SetRemovable(true);
+ lldb::CommandObjectSP new_command_sp(new_command);
+ if (new_command_sp && m_opaque_sp->LoadSubCommand(name, new_command_sp))
+ return lldb::SBCommand(new_command_sp);
+ return lldb::SBCommand();
+}
+
+lldb::SBCommand SBCommand::AddCommand(const char *name,
+ lldb::SBCommandPluginInterface *impl,
+ const char *help) {
+ if (!IsValid())
+ return lldb::SBCommand();
+ if (!m_opaque_sp->IsMultiwordObject())
+ return lldb::SBCommand();
+ lldb::CommandObjectSP new_command_sp;
+ new_command_sp.reset(new CommandPluginInterfaceImplementation(
+ m_opaque_sp->GetCommandInterpreter(), name, impl, help));
+ if (new_command_sp && m_opaque_sp->LoadSubCommand(name, new_command_sp))
+ return lldb::SBCommand(new_command_sp);
+ return lldb::SBCommand();
+}
+
+lldb::SBCommand SBCommand::AddCommand(const char *name,
+ lldb::SBCommandPluginInterface *impl,
+ const char *help, const char *syntax) {
+ if (!IsValid())
+ return lldb::SBCommand();
+ if (!m_opaque_sp->IsMultiwordObject())
return lldb::SBCommand();
+ lldb::CommandObjectSP new_command_sp;
+ new_command_sp.reset(new CommandPluginInterfaceImplementation(
+ m_opaque_sp->GetCommandInterpreter(), name, impl, help, syntax));
+ if (new_command_sp && m_opaque_sp->LoadSubCommand(name, new_command_sp))
+ return lldb::SBCommand(new_command_sp);
+ return lldb::SBCommand();
}
-uint32_t
-SBCommand::GetFlags ()
-{
- return (IsValid() ? m_opaque_sp->GetFlags().Get() : 0);
+uint32_t SBCommand::GetFlags() {
+ return (IsValid() ? m_opaque_sp->GetFlags().Get() : 0);
}
-void
-SBCommand::SetFlags (uint32_t flags)
-{
- if (IsValid())
- m_opaque_sp->GetFlags().Set(flags);
+void SBCommand::SetFlags(uint32_t flags) {
+ if (IsValid())
+ m_opaque_sp->GetFlags().Set(flags);
}
diff --git a/source/API/SBCommandReturnObject.cpp b/source/API/SBCommandReturnObject.cpp
index a7bc31da8a89..41d5147af707 100644
--- a/source/API/SBCommandReturnObject.cpp
+++ b/source/API/SBCommandReturnObject.cpp
@@ -22,333 +22,259 @@
using namespace lldb;
using namespace lldb_private;
-SBCommandReturnObject::SBCommandReturnObject () :
- m_opaque_ap (new CommandReturnObject ())
-{
-}
+SBCommandReturnObject::SBCommandReturnObject()
+ : m_opaque_ap(new CommandReturnObject()) {}
-SBCommandReturnObject::SBCommandReturnObject (const SBCommandReturnObject &rhs):
- m_opaque_ap ()
-{
- if (rhs.m_opaque_ap)
- m_opaque_ap.reset (new CommandReturnObject (*rhs.m_opaque_ap));
+SBCommandReturnObject::SBCommandReturnObject(const SBCommandReturnObject &rhs)
+ : m_opaque_ap() {
+ if (rhs.m_opaque_ap)
+ m_opaque_ap.reset(new CommandReturnObject(*rhs.m_opaque_ap));
}
-SBCommandReturnObject::SBCommandReturnObject (CommandReturnObject *ptr) :
- m_opaque_ap (ptr)
-{
-}
+SBCommandReturnObject::SBCommandReturnObject(CommandReturnObject *ptr)
+ : m_opaque_ap(ptr) {}
SBCommandReturnObject::~SBCommandReturnObject() = default;
-CommandReturnObject *
-SBCommandReturnObject::Release ()
-{
- return m_opaque_ap.release();
+CommandReturnObject *SBCommandReturnObject::Release() {
+ return m_opaque_ap.release();
}
-const SBCommandReturnObject &
-SBCommandReturnObject::operator = (const SBCommandReturnObject &rhs)
-{
- if (this != &rhs)
- {
- if (rhs.m_opaque_ap)
- m_opaque_ap.reset (new CommandReturnObject (*rhs.m_opaque_ap));
- else
- m_opaque_ap.reset();
- }
- return *this;
+const SBCommandReturnObject &SBCommandReturnObject::
+operator=(const SBCommandReturnObject &rhs) {
+ if (this != &rhs) {
+ if (rhs.m_opaque_ap)
+ m_opaque_ap.reset(new CommandReturnObject(*rhs.m_opaque_ap));
+ else
+ m_opaque_ap.reset();
+ }
+ return *this;
}
-bool
-SBCommandReturnObject::IsValid() const
-{
- return m_opaque_ap.get() != nullptr;
+bool SBCommandReturnObject::IsValid() const {
+ return m_opaque_ap.get() != nullptr;
}
-const char *
-SBCommandReturnObject::GetOutput ()
-{
- Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (m_opaque_ap)
- {
- if (log)
- log->Printf ("SBCommandReturnObject(%p)::GetOutput () => \"%s\"",
- static_cast<void*>(m_opaque_ap.get()),
- m_opaque_ap->GetOutputData());
+const char *SBCommandReturnObject::GetOutput() {
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- return m_opaque_ap->GetOutputData();
- }
+ if (m_opaque_ap) {
+ llvm::StringRef output = m_opaque_ap->GetOutputData();
+ ConstString result(output.empty() ? llvm::StringRef("") : output);
if (log)
- log->Printf ("SBCommandReturnObject(%p)::GetOutput () => nullptr",
- static_cast<void*>(m_opaque_ap.get()));
+ log->Printf("SBCommandReturnObject(%p)::GetOutput () => \"%s\"",
+ static_cast<void *>(m_opaque_ap.get()), result.AsCString());
- return nullptr;
-}
+ return result.AsCString();
+ }
-const char *
-SBCommandReturnObject::GetError ()
-{
- Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBCommandReturnObject(%p)::GetOutput () => nullptr",
+ static_cast<void *>(m_opaque_ap.get()));
- if (m_opaque_ap)
- {
- if (log)
- log->Printf ("SBCommandReturnObject(%p)::GetError () => \"%s\"",
- static_cast<void*>(m_opaque_ap.get()),
- m_opaque_ap->GetErrorData());
+ return nullptr;
+}
- return m_opaque_ap->GetErrorData();
- }
+const char *SBCommandReturnObject::GetError() {
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (m_opaque_ap) {
+ llvm::StringRef output = m_opaque_ap->GetErrorData();
+ ConstString result(output.empty() ? llvm::StringRef("") : output);
if (log)
- log->Printf ("SBCommandReturnObject(%p)::GetError () => nullptr",
- static_cast<void*>(m_opaque_ap.get()));
+ log->Printf("SBCommandReturnObject(%p)::GetError () => \"%s\"",
+ static_cast<void *>(m_opaque_ap.get()), result.AsCString());
- return nullptr;
+ return result.AsCString();
+ }
+
+ if (log)
+ log->Printf("SBCommandReturnObject(%p)::GetError () => nullptr",
+ static_cast<void *>(m_opaque_ap.get()));
+
+ return nullptr;
}
-size_t
-SBCommandReturnObject::GetOutputSize()
-{
- return (m_opaque_ap ? strlen(m_opaque_ap->GetOutputData()) : 0);
+size_t SBCommandReturnObject::GetOutputSize() {
+ return (m_opaque_ap ? m_opaque_ap->GetOutputData().size() : 0);
}
-size_t
-SBCommandReturnObject::GetErrorSize()
-{
- return (m_opaque_ap ? strlen(m_opaque_ap->GetErrorData()) : 0);
+size_t SBCommandReturnObject::GetErrorSize() {
+ return (m_opaque_ap ? m_opaque_ap->GetErrorData().size() : 0);
}
-size_t
-SBCommandReturnObject::PutOutput (FILE *fh)
-{
- if (fh)
- {
- size_t num_bytes = GetOutputSize ();
- if (num_bytes)
- return ::fprintf (fh, "%s", GetOutput());
- }
- return 0;
+size_t SBCommandReturnObject::PutOutput(FILE *fh) {
+ if (fh) {
+ size_t num_bytes = GetOutputSize();
+ if (num_bytes)
+ return ::fprintf(fh, "%s", GetOutput());
+ }
+ return 0;
}
-size_t
-SBCommandReturnObject::PutError (FILE *fh)
-{
- if (fh)
- {
- size_t num_bytes = GetErrorSize ();
- if (num_bytes)
- return ::fprintf (fh, "%s", GetError());
- }
- return 0;
+size_t SBCommandReturnObject::PutError(FILE *fh) {
+ if (fh) {
+ size_t num_bytes = GetErrorSize();
+ if (num_bytes)
+ return ::fprintf(fh, "%s", GetError());
+ }
+ return 0;
}
-void
-SBCommandReturnObject::Clear()
-{
- if (m_opaque_ap)
- m_opaque_ap->Clear();
+void SBCommandReturnObject::Clear() {
+ if (m_opaque_ap)
+ m_opaque_ap->Clear();
}
-lldb::ReturnStatus
-SBCommandReturnObject::GetStatus()
-{
- return (m_opaque_ap ? m_opaque_ap->GetStatus() : lldb::eReturnStatusInvalid);
+lldb::ReturnStatus SBCommandReturnObject::GetStatus() {
+ return (m_opaque_ap ? m_opaque_ap->GetStatus() : lldb::eReturnStatusInvalid);
}
-void
-SBCommandReturnObject::SetStatus(lldb::ReturnStatus status)
-{
- if (m_opaque_ap)
- m_opaque_ap->SetStatus(status);
+void SBCommandReturnObject::SetStatus(lldb::ReturnStatus status) {
+ if (m_opaque_ap)
+ m_opaque_ap->SetStatus(status);
}
-bool
-SBCommandReturnObject::Succeeded()
-{
- return (m_opaque_ap ? m_opaque_ap->Succeeded() : false);
+bool SBCommandReturnObject::Succeeded() {
+ return (m_opaque_ap ? m_opaque_ap->Succeeded() : false);
}
-bool
-SBCommandReturnObject::HasResult()
-{
- return (m_opaque_ap ? m_opaque_ap->HasResult() : false);
+bool SBCommandReturnObject::HasResult() {
+ return (m_opaque_ap ? m_opaque_ap->HasResult() : false);
}
-void
-SBCommandReturnObject::AppendMessage (const char *message)
-{
- if (m_opaque_ap)
- m_opaque_ap->AppendMessage (message);
+void SBCommandReturnObject::AppendMessage(const char *message) {
+ if (m_opaque_ap)
+ m_opaque_ap->AppendMessage(message);
}
-void
-SBCommandReturnObject::AppendWarning (const char *message)
-{
- if (m_opaque_ap)
- m_opaque_ap->AppendWarning (message);
+void SBCommandReturnObject::AppendWarning(const char *message) {
+ if (m_opaque_ap)
+ m_opaque_ap->AppendWarning(message);
}
-CommandReturnObject *
-SBCommandReturnObject::operator ->() const
-{
- return m_opaque_ap.get();
+CommandReturnObject *SBCommandReturnObject::operator->() const {
+ return m_opaque_ap.get();
}
-CommandReturnObject *
-SBCommandReturnObject::get() const
-{
- return m_opaque_ap.get();
+CommandReturnObject *SBCommandReturnObject::get() const {
+ return m_opaque_ap.get();
}
-CommandReturnObject &
-SBCommandReturnObject::operator *() const
-{
- assert(m_opaque_ap.get());
- return *(m_opaque_ap.get());
+CommandReturnObject &SBCommandReturnObject::operator*() const {
+ assert(m_opaque_ap.get());
+ return *(m_opaque_ap.get());
}
-CommandReturnObject &
-SBCommandReturnObject::ref() const
-{
- assert(m_opaque_ap.get());
- return *(m_opaque_ap.get());
+CommandReturnObject &SBCommandReturnObject::ref() const {
+ assert(m_opaque_ap.get());
+ return *(m_opaque_ap.get());
}
-void
-SBCommandReturnObject::SetLLDBObjectPtr (CommandReturnObject *ptr)
-{
- if (m_opaque_ap)
- m_opaque_ap.reset (ptr);
+void SBCommandReturnObject::SetLLDBObjectPtr(CommandReturnObject *ptr) {
+ if (m_opaque_ap)
+ m_opaque_ap.reset(ptr);
}
-bool
-SBCommandReturnObject::GetDescription (SBStream &description)
-{
- Stream &strm = description.ref();
+bool SBCommandReturnObject::GetDescription(SBStream &description) {
+ Stream &strm = description.ref();
- if (m_opaque_ap)
- {
- description.Printf ("Status: ");
- lldb::ReturnStatus status = m_opaque_ap->GetStatus();
- if (status == lldb::eReturnStatusStarted)
- strm.PutCString ("Started");
- else if (status == lldb::eReturnStatusInvalid)
- strm.PutCString ("Invalid");
- else if (m_opaque_ap->Succeeded())
- strm.PutCString ("Success");
- else
- strm.PutCString ("Fail");
+ if (m_opaque_ap) {
+ description.Printf("Status: ");
+ lldb::ReturnStatus status = m_opaque_ap->GetStatus();
+ if (status == lldb::eReturnStatusStarted)
+ strm.PutCString("Started");
+ else if (status == lldb::eReturnStatusInvalid)
+ strm.PutCString("Invalid");
+ else if (m_opaque_ap->Succeeded())
+ strm.PutCString("Success");
+ else
+ strm.PutCString("Fail");
- if (GetOutputSize() > 0)
- strm.Printf ("\nOutput Message:\n%s", GetOutput());
+ if (GetOutputSize() > 0)
+ strm.Printf("\nOutput Message:\n%s", GetOutput());
- if (GetErrorSize() > 0)
- strm.Printf ("\nError Message:\n%s", GetError());
- }
- else
- strm.PutCString ("No value");
-
- return true;
-}
-
-void
-SBCommandReturnObject::SetImmediateOutputFile(FILE *fh)
-{
- SetImmediateOutputFile(fh, false);
-}
-
-void
-SBCommandReturnObject::SetImmediateErrorFile(FILE *fh)
-{
- SetImmediateErrorFile(fh, false);
-}
-
-void
-SBCommandReturnObject::SetImmediateOutputFile(FILE *fh, bool transfer_ownership)
-{
- if (m_opaque_ap)
- m_opaque_ap->SetImmediateOutputFile(fh, transfer_ownership);
-}
-
-void
-SBCommandReturnObject::SetImmediateErrorFile(FILE *fh, bool transfer_ownership)
-{
- if (m_opaque_ap)
- m_opaque_ap->SetImmediateErrorFile(fh, transfer_ownership);
-}
-
-void
-SBCommandReturnObject::PutCString(const char* string, int len)
-{
- if (m_opaque_ap)
- {
- if (len == 0 || string == nullptr || *string == 0)
- {
- return;
- }
- else if (len > 0)
- {
- std::string buffer(string, len);
- m_opaque_ap->AppendMessage(buffer.c_str());
- }
- else
- m_opaque_ap->AppendMessage(string);
- }
-}
-
-const char *
-SBCommandReturnObject::GetOutput (bool only_if_no_immediate)
-{
- if (!m_opaque_ap)
- return nullptr;
- if (!only_if_no_immediate || m_opaque_ap->GetImmediateOutputStream().get() == nullptr)
- return GetOutput();
- return nullptr;
+ if (GetErrorSize() > 0)
+ strm.Printf("\nError Message:\n%s", GetError());
+ } else
+ strm.PutCString("No value");
+
+ return true;
+}
+
+void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh) {
+ SetImmediateOutputFile(fh, false);
}
-const char *
-SBCommandReturnObject::GetError (bool only_if_no_immediate)
-{
- if (!m_opaque_ap)
- return nullptr;
- if (!only_if_no_immediate || m_opaque_ap->GetImmediateErrorStream().get() == nullptr)
- return GetError();
+void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh) {
+ SetImmediateErrorFile(fh, false);
+}
+
+void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh,
+ bool transfer_ownership) {
+ if (m_opaque_ap)
+ m_opaque_ap->SetImmediateOutputFile(fh, transfer_ownership);
+}
+
+void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh,
+ bool transfer_ownership) {
+ if (m_opaque_ap)
+ m_opaque_ap->SetImmediateErrorFile(fh, transfer_ownership);
+}
+
+void SBCommandReturnObject::PutCString(const char *string, int len) {
+ if (m_opaque_ap) {
+ if (len == 0 || string == nullptr || *string == 0) {
+ return;
+ } else if (len > 0) {
+ std::string buffer(string, len);
+ m_opaque_ap->AppendMessage(buffer.c_str());
+ } else
+ m_opaque_ap->AppendMessage(string);
+ }
+}
+
+const char *SBCommandReturnObject::GetOutput(bool only_if_no_immediate) {
+ if (!m_opaque_ap)
return nullptr;
+ if (!only_if_no_immediate ||
+ m_opaque_ap->GetImmediateOutputStream().get() == nullptr)
+ return GetOutput();
+ return nullptr;
}
-size_t
-SBCommandReturnObject::Printf(const char* format, ...)
-{
- if (m_opaque_ap)
- {
- va_list args;
- va_start (args, format);
- size_t result = m_opaque_ap->GetOutputStream().PrintfVarArg(format, args);
- va_end (args);
- return result;
- }
- return 0;
-}
-
-void
-SBCommandReturnObject::SetError (lldb::SBError &error, const char *fallback_error_cstr)
-{
- if (m_opaque_ap)
- {
- if (error.IsValid())
- m_opaque_ap->SetError(error.ref(), fallback_error_cstr);
- else if (fallback_error_cstr)
- m_opaque_ap->SetError(Error(), fallback_error_cstr);
- }
-}
-
-void
-SBCommandReturnObject::SetError (const char *error_cstr)
-{
- if (m_opaque_ap && error_cstr)
- m_opaque_ap->SetError(error_cstr);
+const char *SBCommandReturnObject::GetError(bool only_if_no_immediate) {
+ if (!m_opaque_ap)
+ return nullptr;
+ if (!only_if_no_immediate ||
+ m_opaque_ap->GetImmediateErrorStream().get() == nullptr)
+ return GetError();
+ return nullptr;
+}
+
+size_t SBCommandReturnObject::Printf(const char *format, ...) {
+ if (m_opaque_ap) {
+ va_list args;
+ va_start(args, format);
+ size_t result = m_opaque_ap->GetOutputStream().PrintfVarArg(format, args);
+ va_end(args);
+ return result;
+ }
+ return 0;
+}
+
+void SBCommandReturnObject::SetError(lldb::SBError &error,
+ const char *fallback_error_cstr) {
+ if (m_opaque_ap) {
+ if (error.IsValid())
+ m_opaque_ap->SetError(error.ref(), fallback_error_cstr);
+ else if (fallback_error_cstr)
+ m_opaque_ap->SetError(Error(), fallback_error_cstr);
+ }
+}
+
+void SBCommandReturnObject::SetError(const char *error_cstr) {
+ if (m_opaque_ap && error_cstr)
+ m_opaque_ap->SetError(error_cstr);
}
diff --git a/source/API/SBCommunication.cpp b/source/API/SBCommunication.cpp
index 956b6cfcdd31..9519c02f7e22 100644
--- a/source/API/SBCommunication.cpp
+++ b/source/API/SBCommunication.cpp
@@ -16,270 +16,229 @@
using namespace lldb;
using namespace lldb_private;
+SBCommunication::SBCommunication() : m_opaque(NULL), m_opaque_owned(false) {}
+SBCommunication::SBCommunication(const char *broadcaster_name)
+ : m_opaque(new Communication(broadcaster_name)), m_opaque_owned(true) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-SBCommunication::SBCommunication() :
- m_opaque (NULL),
- m_opaque_owned (false)
-{
+ if (log)
+ log->Printf("SBCommunication::SBCommunication (broadcaster_name=\"%s\") => "
+ "SBCommunication(%p)",
+ broadcaster_name, static_cast<void *>(m_opaque));
}
-SBCommunication::SBCommunication(const char * broadcaster_name) :
- m_opaque (new Communication (broadcaster_name)),
- m_opaque_owned (true)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (log)
- log->Printf ("SBCommunication::SBCommunication (broadcaster_name=\"%s\") => "
- "SBCommunication(%p)", broadcaster_name,
- static_cast<void*>(m_opaque));
+SBCommunication::~SBCommunication() {
+ if (m_opaque && m_opaque_owned)
+ delete m_opaque;
+ m_opaque = NULL;
+ m_opaque_owned = false;
}
-SBCommunication::~SBCommunication()
-{
- if (m_opaque && m_opaque_owned)
- delete m_opaque;
- m_opaque = NULL;
- m_opaque_owned = false;
-}
+bool SBCommunication::IsValid() const { return m_opaque != NULL; }
-bool
-SBCommunication::IsValid () const
-{
- return m_opaque != NULL;
+bool SBCommunication::GetCloseOnEOF() {
+ if (m_opaque)
+ return m_opaque->GetCloseOnEOF();
+ return false;
}
-bool
-SBCommunication::GetCloseOnEOF ()
-{
- if (m_opaque)
- return m_opaque->GetCloseOnEOF ();
- return false;
+void SBCommunication::SetCloseOnEOF(bool b) {
+ if (m_opaque)
+ m_opaque->SetCloseOnEOF(b);
}
-void
-SBCommunication::SetCloseOnEOF (bool b)
-{
- if (m_opaque)
- m_opaque->SetCloseOnEOF (b);
+ConnectionStatus SBCommunication::Connect(const char *url) {
+ if (m_opaque) {
+ if (!m_opaque->HasConnection())
+ m_opaque->SetConnection(Connection::CreateDefaultConnection(url));
+ return m_opaque->Connect(url, NULL);
+ }
+ return eConnectionStatusNoConnection;
}
-ConnectionStatus
-SBCommunication::Connect (const char *url)
-{
- if (m_opaque)
- {
- if (!m_opaque->HasConnection ())
- m_opaque->SetConnection(Connection::CreateDefaultConnection(url));
- return m_opaque->Connect (url, NULL);
- }
- return eConnectionStatusNoConnection;
-}
+ConnectionStatus SBCommunication::AdoptFileDesriptor(int fd, bool owns_fd) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-ConnectionStatus
-SBCommunication::AdoptFileDesriptor (int fd, bool owns_fd)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- ConnectionStatus status = eConnectionStatusNoConnection;
- if (m_opaque)
- {
- if (m_opaque->HasConnection ())
- {
- if (m_opaque->IsConnected())
- m_opaque->Disconnect();
- }
- m_opaque->SetConnection (new ConnectionFileDescriptor (fd, owns_fd));
- if (m_opaque->IsConnected())
- status = eConnectionStatusSuccess;
- else
- status = eConnectionStatusLostConnection;
+ ConnectionStatus status = eConnectionStatusNoConnection;
+ if (m_opaque) {
+ if (m_opaque->HasConnection()) {
+ if (m_opaque->IsConnected())
+ m_opaque->Disconnect();
}
+ m_opaque->SetConnection(new ConnectionFileDescriptor(fd, owns_fd));
+ if (m_opaque->IsConnected())
+ status = eConnectionStatusSuccess;
+ else
+ status = eConnectionStatusLostConnection;
+ }
- if (log)
- log->Printf ("SBCommunication(%p)::AdoptFileDescriptor (fd=%d, ownd_fd=%i) => %s",
- static_cast<void*>(m_opaque), fd, owns_fd,
- Communication::ConnectionStatusAsCString (status));
-
- return status;
-}
-
-
-ConnectionStatus
-SBCommunication::Disconnect ()
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- ConnectionStatus status= eConnectionStatusNoConnection;
- if (m_opaque)
- status = m_opaque->Disconnect ();
-
- if (log)
- log->Printf ("SBCommunication(%p)::Disconnect () => %s",
- static_cast<void*>(m_opaque),
- Communication::ConnectionStatusAsCString (status));
-
- return status;
+ if (log)
+ log->Printf(
+ "SBCommunication(%p)::AdoptFileDescriptor (fd=%d, ownd_fd=%i) => %s",
+ static_cast<void *>(m_opaque), fd, owns_fd,
+ Communication::ConnectionStatusAsCString(status));
+
+ return status;
}
-bool
-SBCommunication::IsConnected () const
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- bool result = false;
- if (m_opaque)
- result = m_opaque->IsConnected ();
+ConnectionStatus SBCommunication::Disconnect() {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ ConnectionStatus status = eConnectionStatusNoConnection;
+ if (m_opaque)
+ status = m_opaque->Disconnect();
- if (log)
- log->Printf ("SBCommunication(%p)::IsConnected () => %i",
- static_cast<void*>(m_opaque), result);
+ if (log)
+ log->Printf("SBCommunication(%p)::Disconnect () => %s",
+ static_cast<void *>(m_opaque),
+ Communication::ConnectionStatusAsCString(status));
+
+ return status;
+}
+
+bool SBCommunication::IsConnected() const {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ bool result = false;
+ if (m_opaque)
+ result = m_opaque->IsConnected();
- return false;
+ if (log)
+ log->Printf("SBCommunication(%p)::IsConnected () => %i",
+ static_cast<void *>(m_opaque), result);
+
+ return false;
}
-size_t
-SBCommunication::Read (void *dst, size_t dst_len, uint32_t timeout_usec, ConnectionStatus &status)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 ", timeout_usec=%u, &status)...",
- static_cast<void*>(m_opaque), static_cast<void*>(dst),
- static_cast<uint64_t>(dst_len), timeout_usec);
- size_t bytes_read = 0;
- if (m_opaque)
- bytes_read = m_opaque->Read (dst, dst_len, timeout_usec, status, NULL);
- else
- status = eConnectionStatusNoConnection;
-
- if (log)
- log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 ", timeout_usec=%u, &status=%s) => %" PRIu64,
- static_cast<void*>(m_opaque), static_cast<void*>(dst),
- static_cast<uint64_t>(dst_len), timeout_usec,
- Communication::ConnectionStatusAsCString (status),
- static_cast<uint64_t>(bytes_read));
- return bytes_read;
+size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec,
+ ConnectionStatus &status) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64
+ ", timeout_usec=%u, &status)...",
+ static_cast<void *>(m_opaque), static_cast<void *>(dst),
+ static_cast<uint64_t>(dst_len), timeout_usec);
+ size_t bytes_read = 0;
+ Timeout<std::micro> timeout = timeout_usec == UINT32_MAX
+ ? Timeout<std::micro>(llvm::None)
+ : std::chrono::microseconds(timeout_usec);
+ if (m_opaque)
+ bytes_read = m_opaque->Read(dst, dst_len, timeout, status, NULL);
+ else
+ status = eConnectionStatusNoConnection;
+
+ if (log)
+ log->Printf("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64
+ ", timeout_usec=%u, &status=%s) => %" PRIu64,
+ static_cast<void *>(m_opaque), static_cast<void *>(dst),
+ static_cast<uint64_t>(dst_len), timeout_usec,
+ Communication::ConnectionStatusAsCString(status),
+ static_cast<uint64_t>(bytes_read));
+ return bytes_read;
}
+size_t SBCommunication::Write(const void *src, size_t src_len,
+ ConnectionStatus &status) {
+ size_t bytes_written = 0;
+ if (m_opaque)
+ bytes_written = m_opaque->Write(src, src_len, status, NULL);
+ else
+ status = eConnectionStatusNoConnection;
-size_t
-SBCommunication::Write (const void *src, size_t src_len, ConnectionStatus &status)
-{
- size_t bytes_written = 0;
- if (m_opaque)
- bytes_written = m_opaque->Write (src, src_len, status, NULL);
- else
- status = eConnectionStatusNoConnection;
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBCommunication(%p)::Write (src=%p, src_len=%" PRIu64
+ ", &status=%s) => %" PRIu64,
+ static_cast<void *>(m_opaque), static_cast<const void *>(src),
+ static_cast<uint64_t>(src_len),
+ Communication::ConnectionStatusAsCString(status),
+ static_cast<uint64_t>(bytes_written));
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBCommunication(%p)::Write (src=%p, src_len=%" PRIu64 ", &status=%s) => %" PRIu64,
- static_cast<void*>(m_opaque), static_cast<const void*>(src),
- static_cast<uint64_t>(src_len),
- Communication::ConnectionStatusAsCString (status),
- static_cast<uint64_t>(bytes_written));
-
- return 0;
+ return 0;
}
-bool
-SBCommunication::ReadThreadStart ()
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+bool SBCommunication::ReadThreadStart() {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- bool success = false;
- if (m_opaque)
- success = m_opaque->StartReadThread ();
+ bool success = false;
+ if (m_opaque)
+ success = m_opaque->StartReadThread();
- if (log)
- log->Printf ("SBCommunication(%p)::ReadThreadStart () => %i",
- static_cast<void*>(m_opaque), success);
+ if (log)
+ log->Printf("SBCommunication(%p)::ReadThreadStart () => %i",
+ static_cast<void *>(m_opaque), success);
- return success;
+ return success;
}
+bool SBCommunication::ReadThreadStop() {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBCommunication(%p)::ReadThreadStop ()...",
+ static_cast<void *>(m_opaque));
-bool
-SBCommunication::ReadThreadStop ()
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBCommunication(%p)::ReadThreadStop ()...",
- static_cast<void*>(m_opaque));
-
- bool success = false;
- if (m_opaque)
- success = m_opaque->StopReadThread ();
+ bool success = false;
+ if (m_opaque)
+ success = m_opaque->StopReadThread();
- if (log)
- log->Printf ("SBCommunication(%p)::ReadThreadStop () => %i",
- static_cast<void*>(m_opaque), success);
+ if (log)
+ log->Printf("SBCommunication(%p)::ReadThreadStop () => %i",
+ static_cast<void *>(m_opaque), success);
- return success;
+ return success;
}
-bool
-SBCommunication::ReadThreadIsRunning ()
-{
- bool result = false;
- if (m_opaque)
- result = m_opaque->ReadThreadIsRunning ();
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBCommunication(%p)::ReadThreadIsRunning () => %i",
- static_cast<void*>(m_opaque), result);
- return result;
+bool SBCommunication::ReadThreadIsRunning() {
+ bool result = false;
+ if (m_opaque)
+ result = m_opaque->ReadThreadIsRunning();
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBCommunication(%p)::ReadThreadIsRunning () => %i",
+ static_cast<void *>(m_opaque), result);
+ return result;
}
-bool
-SBCommunication::SetReadThreadBytesReceivedCallback
-(
- ReadThreadBytesReceived callback,
- void *callback_baton
-)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- bool result = false;
- if (m_opaque)
- {
- m_opaque->SetReadThreadBytesReceivedCallback (callback, callback_baton);
- result = true;
- }
+bool SBCommunication::SetReadThreadBytesReceivedCallback(
+ ReadThreadBytesReceived callback, void *callback_baton) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+
+ bool result = false;
+ if (m_opaque) {
+ m_opaque->SetReadThreadBytesReceivedCallback(callback, callback_baton);
+ result = true;
+ }
- if (log)
- log->Printf ("SBCommunication(%p)::SetReadThreadBytesReceivedCallback (callback=%p, baton=%p) => %i",
- static_cast<void*>(m_opaque),
- reinterpret_cast<void*>(reinterpret_cast<intptr_t>(callback)),
- static_cast<void*>(callback_baton), result);
+ if (log)
+ log->Printf("SBCommunication(%p)::SetReadThreadBytesReceivedCallback "
+ "(callback=%p, baton=%p) => %i",
+ static_cast<void *>(m_opaque),
+ reinterpret_cast<void *>(reinterpret_cast<intptr_t>(callback)),
+ static_cast<void *>(callback_baton), result);
- return result;
+ return result;
}
-SBBroadcaster
-SBCommunication::GetBroadcaster ()
-{
- SBBroadcaster broadcaster (m_opaque, false);
+SBBroadcaster SBCommunication::GetBroadcaster() {
+ SBBroadcaster broadcaster(m_opaque, false);
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- log->Printf ("SBCommunication(%p)::GetBroadcaster () => SBBroadcaster (%p)",
- static_cast<void*>(m_opaque),
- static_cast<void*>(broadcaster.get()));
+ if (log)
+ log->Printf("SBCommunication(%p)::GetBroadcaster () => SBBroadcaster (%p)",
+ static_cast<void *>(m_opaque),
+ static_cast<void *>(broadcaster.get()));
- return broadcaster;
+ return broadcaster;
}
-const char *
-SBCommunication::GetBroadcasterClass ()
-{
- return Communication::GetStaticBroadcasterClass().AsCString();
+const char *SBCommunication::GetBroadcasterClass() {
+ return Communication::GetStaticBroadcasterClass().AsCString();
}
//
-//void
-//SBCommunication::CreateIfNeeded ()
+// void
+// SBCommunication::CreateIfNeeded ()
//{
// if (m_opaque == NULL)
// {
diff --git a/source/API/SBCompileUnit.cpp b/source/API/SBCompileUnit.cpp
index 5d904ce56300..12aed5911de7 100644
--- a/source/API/SBCompileUnit.cpp
+++ b/source/API/SBCompileUnit.cpp
@@ -21,275 +21,203 @@
using namespace lldb;
using namespace lldb_private;
+SBCompileUnit::SBCompileUnit() : m_opaque_ptr(NULL) {}
-SBCompileUnit::SBCompileUnit () :
- m_opaque_ptr (NULL)
-{
-}
-
-SBCompileUnit::SBCompileUnit (lldb_private::CompileUnit *lldb_object_ptr) :
- m_opaque_ptr (lldb_object_ptr)
-{
-}
+SBCompileUnit::SBCompileUnit(lldb_private::CompileUnit *lldb_object_ptr)
+ : m_opaque_ptr(lldb_object_ptr) {}
-SBCompileUnit::SBCompileUnit(const SBCompileUnit &rhs) :
- m_opaque_ptr (rhs.m_opaque_ptr)
-{
-}
+SBCompileUnit::SBCompileUnit(const SBCompileUnit &rhs)
+ : m_opaque_ptr(rhs.m_opaque_ptr) {}
-const SBCompileUnit &
-SBCompileUnit::operator = (const SBCompileUnit &rhs)
-{
- m_opaque_ptr = rhs.m_opaque_ptr;
- return *this;
+const SBCompileUnit &SBCompileUnit::operator=(const SBCompileUnit &rhs) {
+ m_opaque_ptr = rhs.m_opaque_ptr;
+ return *this;
}
+SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = NULL; }
-SBCompileUnit::~SBCompileUnit ()
-{
- m_opaque_ptr = NULL;
+SBFileSpec SBCompileUnit::GetFileSpec() const {
+ SBFileSpec file_spec;
+ if (m_opaque_ptr)
+ file_spec.SetFileSpec(*m_opaque_ptr);
+ return file_spec;
}
-SBFileSpec
-SBCompileUnit::GetFileSpec () const
-{
- SBFileSpec file_spec;
- if (m_opaque_ptr)
- file_spec.SetFileSpec(*m_opaque_ptr);
- return file_spec;
+uint32_t SBCompileUnit::GetNumLineEntries() const {
+ if (m_opaque_ptr) {
+ LineTable *line_table = m_opaque_ptr->GetLineTable();
+ if (line_table)
+ return line_table->GetSize();
+ }
+ return 0;
}
-uint32_t
-SBCompileUnit::GetNumLineEntries () const
-{
- if (m_opaque_ptr)
- {
- LineTable *line_table = m_opaque_ptr->GetLineTable ();
- if (line_table)
- return line_table->GetSize();
- }
- return 0;
-}
+SBLineEntry SBCompileUnit::GetLineEntryAtIndex(uint32_t idx) const {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
-SBLineEntry
-SBCompileUnit::GetLineEntryAtIndex (uint32_t idx) const
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- SBLineEntry sb_line_entry;
- if (m_opaque_ptr)
- {
- LineTable *line_table = m_opaque_ptr->GetLineTable ();
- if (line_table)
- {
- LineEntry line_entry;
- if (line_table->GetLineEntryAtIndex(idx, line_entry))
- sb_line_entry.SetLineEntry(line_entry);
- }
+ SBLineEntry sb_line_entry;
+ if (m_opaque_ptr) {
+ LineTable *line_table = m_opaque_ptr->GetLineTable();
+ if (line_table) {
+ LineEntry line_entry;
+ if (line_table->GetLineEntryAtIndex(idx, line_entry))
+ sb_line_entry.SetLineEntry(line_entry);
}
+ }
- if (log)
- {
- SBStream sstr;
- sb_line_entry.GetDescription (sstr);
- log->Printf ("SBCompileUnit(%p)::GetLineEntryAtIndex (idx=%u) => SBLineEntry(%p): '%s'",
- static_cast<void*>(m_opaque_ptr), idx,
- static_cast<void*>(sb_line_entry.get()), sstr.GetData());
- }
+ if (log) {
+ SBStream sstr;
+ sb_line_entry.GetDescription(sstr);
+ log->Printf("SBCompileUnit(%p)::GetLineEntryAtIndex (idx=%u) => "
+ "SBLineEntry(%p): '%s'",
+ static_cast<void *>(m_opaque_ptr), idx,
+ static_cast<void *>(sb_line_entry.get()), sstr.GetData());
+ }
- return sb_line_entry;
+ return sb_line_entry;
}
-uint32_t
-SBCompileUnit::FindLineEntryIndex (uint32_t start_idx, uint32_t line, SBFileSpec *inline_file_spec) const
-{
- const bool exact = true;
- return FindLineEntryIndex (start_idx, line, inline_file_spec, exact);
+uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line,
+ SBFileSpec *inline_file_spec) const {
+ const bool exact = true;
+ return FindLineEntryIndex(start_idx, line, inline_file_spec, exact);
}
-uint32_t
-SBCompileUnit::FindLineEntryIndex (uint32_t start_idx, uint32_t line, SBFileSpec *inline_file_spec, bool exact) const
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- uint32_t index = UINT32_MAX;
- if (m_opaque_ptr)
- {
- FileSpec file_spec;
- if (inline_file_spec && inline_file_spec->IsValid())
- file_spec = inline_file_spec->ref();
- else
- file_spec = *m_opaque_ptr;
-
- index = m_opaque_ptr->FindLineEntry (start_idx,
- line,
- inline_file_spec ? inline_file_spec->get() : NULL,
- exact,
- NULL);
- }
+uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line,
+ SBFileSpec *inline_file_spec,
+ bool exact) const {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
- if (log)
- {
- SBStream sstr;
- if (index == UINT32_MAX)
- {
- log->Printf ("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, line=%u, SBFileSpec(%p)) => NOT FOUND",
- static_cast<void*>(m_opaque_ptr), start_idx, line,
- inline_file_spec
- ? static_cast<const void*>(inline_file_spec->get())
- : NULL);
- }
- else
- {
- log->Printf ("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, line=%u, SBFileSpec(%p)) => %u",
- static_cast<void*>(m_opaque_ptr), start_idx, line,
- inline_file_spec
- ? static_cast<const void*>(inline_file_spec->get())
- : NULL,
- index);
- }
+ uint32_t index = UINT32_MAX;
+ if (m_opaque_ptr) {
+ FileSpec file_spec;
+ if (inline_file_spec && inline_file_spec->IsValid())
+ file_spec = inline_file_spec->ref();
+ else
+ file_spec = *m_opaque_ptr;
+
+ index = m_opaque_ptr->FindLineEntry(
+ start_idx, line, inline_file_spec ? inline_file_spec->get() : NULL,
+ exact, NULL);
+ }
+
+ if (log) {
+ SBStream sstr;
+ if (index == UINT32_MAX) {
+ log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, "
+ "line=%u, SBFileSpec(%p)) => NOT FOUND",
+ static_cast<void *>(m_opaque_ptr), start_idx, line,
+ inline_file_spec
+ ? static_cast<const void *>(inline_file_spec->get())
+ : NULL);
+ } else {
+ log->Printf("SBCompileUnit(%p)::FindLineEntryIndex (start_idx=%u, "
+ "line=%u, SBFileSpec(%p)) => %u",
+ static_cast<void *>(m_opaque_ptr), start_idx, line,
+ inline_file_spec
+ ? static_cast<const void *>(inline_file_spec->get())
+ : NULL,
+ index);
}
+ }
- return index;
+ return index;
}
-uint32_t
-SBCompileUnit::GetNumSupportFiles () const
-{
- if (m_opaque_ptr)
- {
- FileSpecList& support_files = m_opaque_ptr->GetSupportFiles ();
- return support_files.GetSize();
- }
- return 0;
+uint32_t SBCompileUnit::GetNumSupportFiles() const {
+ if (m_opaque_ptr) {
+ FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
+ return support_files.GetSize();
+ }
+ return 0;
}
+lldb::SBTypeList SBCompileUnit::GetTypes(uint32_t type_mask) {
+ SBTypeList sb_type_list;
-
-lldb::SBTypeList
-SBCompileUnit::GetTypes (uint32_t type_mask)
-{
- SBTypeList sb_type_list;
-
- if (m_opaque_ptr)
- {
- ModuleSP module_sp (m_opaque_ptr->GetModule());
- if (module_sp)
- {
- SymbolVendor* vendor = module_sp->GetSymbolVendor();
- if (vendor)
- {
- TypeList type_list;
- vendor->GetTypes (m_opaque_ptr, type_mask, type_list);
- sb_type_list.m_opaque_ap->Append(type_list);
- }
- }
+ if (m_opaque_ptr) {
+ ModuleSP module_sp(m_opaque_ptr->GetModule());
+ if (module_sp) {
+ SymbolVendor *vendor = module_sp->GetSymbolVendor();
+ if (vendor) {
+ TypeList type_list;
+ vendor->GetTypes(m_opaque_ptr, type_mask, type_list);
+ sb_type_list.m_opaque_ap->Append(type_list);
+ }
}
- return sb_type_list;
+ }
+ return sb_type_list;
}
+SBFileSpec SBCompileUnit::GetSupportFileAtIndex(uint32_t idx) const {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ SBFileSpec sb_file_spec;
+ if (m_opaque_ptr) {
+ FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
+ FileSpec file_spec = support_files.GetFileSpecAtIndex(idx);
+ sb_file_spec.SetFileSpec(file_spec);
+ }
+ if (log) {
+ SBStream sstr;
+ sb_file_spec.GetDescription(sstr);
+ log->Printf("SBCompileUnit(%p)::GetGetFileSpecAtIndex (idx=%u) => "
+ "SBFileSpec(%p): '%s'",
+ static_cast<void *>(m_opaque_ptr), idx,
+ static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
+ }
-SBFileSpec
-SBCompileUnit::GetSupportFileAtIndex (uint32_t idx) const
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- SBFileSpec sb_file_spec;
- if (m_opaque_ptr)
- {
- FileSpecList &support_files = m_opaque_ptr->GetSupportFiles ();
- FileSpec file_spec = support_files.GetFileSpecAtIndex(idx);
- sb_file_spec.SetFileSpec(file_spec);
- }
-
- if (log)
- {
- SBStream sstr;
- sb_file_spec.GetDescription (sstr);
- log->Printf ("SBCompileUnit(%p)::GetGetFileSpecAtIndex (idx=%u) => SBFileSpec(%p): '%s'",
- static_cast<void*>(m_opaque_ptr), idx,
- static_cast<const void*>(sb_file_spec.get()),
- sstr.GetData());
- }
-
- return sb_file_spec;
+ return sb_file_spec;
}
-uint32_t
-SBCompileUnit::FindSupportFileIndex (uint32_t start_idx, const SBFileSpec &sb_file, bool full)
-{
- if (m_opaque_ptr)
- {
- FileSpecList &support_files = m_opaque_ptr->GetSupportFiles ();
- return support_files.FindFileIndex(start_idx, sb_file.ref(), full);
- }
- return 0;
+uint32_t SBCompileUnit::FindSupportFileIndex(uint32_t start_idx,
+ const SBFileSpec &sb_file,
+ bool full) {
+ if (m_opaque_ptr) {
+ FileSpecList &support_files = m_opaque_ptr->GetSupportFiles();
+ return support_files.FindFileIndex(start_idx, sb_file.ref(), full);
+ }
+ return 0;
}
-lldb::LanguageType
-SBCompileUnit::GetLanguage ()
-{
- if (m_opaque_ptr)
- return m_opaque_ptr->GetLanguage();
- return lldb::eLanguageTypeUnknown;
+lldb::LanguageType SBCompileUnit::GetLanguage() {
+ if (m_opaque_ptr)
+ return m_opaque_ptr->GetLanguage();
+ return lldb::eLanguageTypeUnknown;
}
-bool
-SBCompileUnit::IsValid () const
-{
- return m_opaque_ptr != NULL;
-}
+bool SBCompileUnit::IsValid() const { return m_opaque_ptr != NULL; }
-bool
-SBCompileUnit::operator == (const SBCompileUnit &rhs) const
-{
- return m_opaque_ptr == rhs.m_opaque_ptr;
+bool SBCompileUnit::operator==(const SBCompileUnit &rhs) const {
+ return m_opaque_ptr == rhs.m_opaque_ptr;
}
-bool
-SBCompileUnit::operator != (const SBCompileUnit &rhs) const
-{
- return m_opaque_ptr != rhs.m_opaque_ptr;
+bool SBCompileUnit::operator!=(const SBCompileUnit &rhs) const {
+ return m_opaque_ptr != rhs.m_opaque_ptr;
}
-const lldb_private::CompileUnit *
-SBCompileUnit::operator->() const
-{
- return m_opaque_ptr;
+const lldb_private::CompileUnit *SBCompileUnit::operator->() const {
+ return m_opaque_ptr;
}
-const lldb_private::CompileUnit &
-SBCompileUnit::operator*() const
-{
- return *m_opaque_ptr;
+const lldb_private::CompileUnit &SBCompileUnit::operator*() const {
+ return *m_opaque_ptr;
}
-lldb_private::CompileUnit *
-SBCompileUnit::get ()
-{
- return m_opaque_ptr;
-}
+lldb_private::CompileUnit *SBCompileUnit::get() { return m_opaque_ptr; }
-void
-SBCompileUnit::reset (lldb_private::CompileUnit *lldb_object_ptr)
-{
- m_opaque_ptr = lldb_object_ptr;
+void SBCompileUnit::reset(lldb_private::CompileUnit *lldb_object_ptr) {
+ m_opaque_ptr = lldb_object_ptr;
}
-
-bool
-SBCompileUnit::GetDescription (SBStream &description)
-{
- Stream &strm = description.ref();
+bool SBCompileUnit::GetDescription(SBStream &description) {
+ Stream &strm = description.ref();
- if (m_opaque_ptr)
- {
- m_opaque_ptr->Dump (&strm, false);
- }
- else
- strm.PutCString ("No value");
-
- return true;
+ if (m_opaque_ptr) {
+ m_opaque_ptr->Dump(&strm, false);
+ } else
+ strm.PutCString("No value");
+
+ return true;
}
diff --git a/source/API/SBData.cpp b/source/API/SBData.cpp
index a58585295a21..d905d3f272f3 100644
--- a/source/API/SBData.cpp
+++ b/source/API/SBData.cpp
@@ -18,788 +18,682 @@
#include "lldb/Core/Log.h"
#include "lldb/Core/Stream.h"
-
using namespace lldb;
using namespace lldb_private;
-SBData::SBData () :
- m_opaque_sp(new DataExtractor())
-{
-}
+SBData::SBData() : m_opaque_sp(new DataExtractor()) {}
-SBData::SBData (const lldb::DataExtractorSP& data_sp) :
- m_opaque_sp (data_sp)
-{
-}
+SBData::SBData(const lldb::DataExtractorSP &data_sp) : m_opaque_sp(data_sp) {}
-SBData::SBData(const SBData &rhs) :
- m_opaque_sp (rhs.m_opaque_sp)
-{
-}
+SBData::SBData(const SBData &rhs) : m_opaque_sp(rhs.m_opaque_sp) {}
-const SBData &
-SBData::operator = (const SBData &rhs)
-{
- if (this != &rhs)
- m_opaque_sp = rhs.m_opaque_sp;
- return *this;
+const SBData &SBData::operator=(const SBData &rhs) {
+ if (this != &rhs)
+ m_opaque_sp = rhs.m_opaque_sp;
+ return *this;
}
-SBData::~SBData ()
-{
-}
+SBData::~SBData() {}
-void
-SBData::SetOpaque (const lldb::DataExtractorSP &data_sp)
-{
- m_opaque_sp = data_sp;
+void SBData::SetOpaque(const lldb::DataExtractorSP &data_sp) {
+ m_opaque_sp = data_sp;
}
-lldb_private::DataExtractor *
-SBData::get() const
-{
- return m_opaque_sp.get();
+lldb_private::DataExtractor *SBData::get() const { return m_opaque_sp.get(); }
+
+lldb_private::DataExtractor *SBData::operator->() const {
+ return m_opaque_sp.operator->();
}
-lldb_private::DataExtractor *
-SBData::operator->() const
-{
- return m_opaque_sp.operator->();
-}
+lldb::DataExtractorSP &SBData::operator*() { return m_opaque_sp; }
-lldb::DataExtractorSP &
-SBData::operator*()
-{
- return m_opaque_sp;
-}
+const lldb::DataExtractorSP &SBData::operator*() const { return m_opaque_sp; }
+
+bool SBData::IsValid() { return m_opaque_sp.get() != NULL; }
+
+uint8_t SBData::GetAddressByteSize() {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ uint8_t value = 0;
+ if (m_opaque_sp.get())
+ value = m_opaque_sp->GetAddressByteSize();
+ if (log)
+ log->Printf("SBData::GetAddressByteSize () => "
+ "(%i)",
+ value);
+ return value;
+}
+
+void SBData::SetAddressByteSize(uint8_t addr_byte_size) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (m_opaque_sp.get())
+ m_opaque_sp->SetAddressByteSize(addr_byte_size);
+ if (log)
+ log->Printf("SBData::SetAddressByteSize (%i)", addr_byte_size);
+}
+
+void SBData::Clear() {
+ if (m_opaque_sp.get())
+ m_opaque_sp->Clear();
+}
+
+size_t SBData::GetByteSize() {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ size_t value = 0;
+ if (m_opaque_sp.get())
+ value = m_opaque_sp->GetByteSize();
+ if (log)
+ log->Printf("SBData::GetByteSize () => "
+ "( %" PRIu64 " )",
+ (uint64_t)value);
+ return value;
+}
+
+lldb::ByteOrder SBData::GetByteOrder() {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ lldb::ByteOrder value = eByteOrderInvalid;
+ if (m_opaque_sp.get())
+ value = m_opaque_sp->GetByteOrder();
+ if (log)
+ log->Printf("SBData::GetByteOrder () => "
+ "(%i)",
+ value);
+ return value;
+}
+
+void SBData::SetByteOrder(lldb::ByteOrder endian) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (m_opaque_sp.get())
+ m_opaque_sp->SetByteOrder(endian);
+ if (log)
+ log->Printf("SBData::GetByteOrder (%i)", endian);
+}
+
+float SBData::GetFloat(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ float value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetFloat(&offset);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => (%f)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+double SBData::GetDouble(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ double value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetDouble(&offset);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => "
+ "(%f)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+long double SBData::GetLongDouble(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ long double value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetLongDouble(&offset);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => "
+ "(%Lf)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+lldb::addr_t SBData::GetAddress(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ lldb::addr_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetAddress(&offset);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => "
+ "(%p)",
+ static_cast<void *>(error.get()), offset,
+ reinterpret_cast<void *>(value));
+ return value;
+}
+
+uint8_t SBData::GetUnsignedInt8(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ uint8_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetU8(&offset);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => "
+ "(%c)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+uint16_t SBData::GetUnsignedInt16(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ uint16_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetU16(&offset);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => "
+ "(%hd)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+uint32_t SBData::GetUnsignedInt32(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ uint32_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetU32(&offset);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => "
+ "(%d)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+uint64_t SBData::GetUnsignedInt64(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ uint64_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetU64(&offset);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => "
+ "(%" PRId64 ")",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+int8_t SBData::GetSignedInt8(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ int8_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = (int8_t)m_opaque_sp->GetMaxS64(&offset, 1);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => "
+ "(%c)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+int16_t SBData::GetSignedInt16(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ int16_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = (int16_t)m_opaque_sp->GetMaxS64(&offset, 2);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => "
+ "(%hd)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+int32_t SBData::GetSignedInt32(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ int32_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = (int32_t)m_opaque_sp->GetMaxS64(&offset, 4);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => "
+ "(%d)",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+int64_t SBData::GetSignedInt64(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ int64_t value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = (int64_t)m_opaque_sp->GetMaxS64(&offset, 8);
+ if (offset == old_offset)
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => "
+ "(%" PRId64 ")",
+ static_cast<void *>(error.get()), offset, value);
+ return value;
+}
+
+const char *SBData::GetString(lldb::SBError &error, lldb::offset_t offset) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ const char *value = 0;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ value = m_opaque_sp->GetCStr(&offset);
+ if (offset == old_offset || (value == NULL))
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::GetString (error=%p,offset=%" PRIu64 ") => (%p)",
+ static_cast<void *>(error.get()), offset,
+ static_cast<const void *>(value));
+ return value;
+}
+
+bool SBData::GetDescription(lldb::SBStream &description,
+ lldb::addr_t base_addr) {
+ Stream &strm = description.ref();
+
+ if (m_opaque_sp) {
+ m_opaque_sp->Dump(&strm, 0, lldb::eFormatBytesWithASCII, 1,
+ m_opaque_sp->GetByteSize(), 16, base_addr, 0, 0);
+ } else
+ strm.PutCString("No value");
+
+ return true;
+}
+
+size_t SBData::ReadRawData(lldb::SBError &error, lldb::offset_t offset,
+ void *buf, size_t size) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ void *ok = NULL;
+ if (!m_opaque_sp.get()) {
+ error.SetErrorString("no value to read from");
+ } else {
+ uint32_t old_offset = offset;
+ ok = m_opaque_sp->GetU8(&offset, buf, size);
+ if ((offset == old_offset) || (ok == NULL))
+ error.SetErrorString("unable to read data");
+ }
+ if (log)
+ log->Printf("SBData::ReadRawData (error=%p,offset=%" PRIu64
+ ",buf=%p,size=%" PRIu64 ") => "
+ "(%p)",
+ static_cast<void *>(error.get()), offset,
+ static_cast<void *>(buf), static_cast<uint64_t>(size),
+ static_cast<void *>(ok));
+ return ok ? size : 0;
+}
+
+void SBData::SetData(lldb::SBError &error, const void *buf, size_t size,
+ lldb::ByteOrder endian, uint8_t addr_size) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (!m_opaque_sp.get())
+ m_opaque_sp.reset(new DataExtractor(buf, size, endian, addr_size));
+ else
+ m_opaque_sp->SetData(buf, size, endian);
+ if (log)
+ log->Printf("SBData::SetData (error=%p,buf=%p,size=%" PRIu64
+ ",endian=%d,addr_size=%c) => "
+ "(%p)",
+ static_cast<void *>(error.get()),
+ static_cast<const void *>(buf), static_cast<uint64_t>(size),
+ endian, addr_size, static_cast<void *>(m_opaque_sp.get()));
+}
+
+bool SBData::Append(const SBData &rhs) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ bool value = false;
+ if (m_opaque_sp.get() && rhs.m_opaque_sp.get())
+ value = m_opaque_sp.get()->Append(*rhs.m_opaque_sp);
+ if (log)
+ log->Printf("SBData::Append (rhs=%p) => (%s)",
+ static_cast<void *>(rhs.get()), value ? "true" : "false");
+ return value;
+}
+
+lldb::SBData SBData::CreateDataFromCString(lldb::ByteOrder endian,
+ uint32_t addr_byte_size,
+ const char *data) {
+ if (!data || !data[0])
+ return SBData();
+
+ uint32_t data_len = strlen(data);
+
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
+ lldb::DataExtractorSP data_sp(
+ new DataExtractor(buffer_sp, endian, addr_byte_size));
-const lldb::DataExtractorSP &
-SBData::operator*() const
-{
- return m_opaque_sp;
+ SBData ret(data_sp);
+
+ return ret;
}
-bool
-SBData::IsValid()
-{
- return m_opaque_sp.get() != NULL;
+lldb::SBData SBData::CreateDataFromUInt64Array(lldb::ByteOrder endian,
+ uint32_t addr_byte_size,
+ uint64_t *array,
+ size_t array_len) {
+ if (!array || array_len == 0)
+ return SBData();
+
+ size_t data_len = array_len * sizeof(uint64_t);
+
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ lldb::DataExtractorSP data_sp(
+ new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+ SBData ret(data_sp);
+
+ return ret;
}
-uint8_t
-SBData::GetAddressByteSize ()
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- uint8_t value = 0;
- if (m_opaque_sp.get())
- value = m_opaque_sp->GetAddressByteSize();
- if (log)
- log->Printf ("SBData::GetAddressByteSize () => "
- "(%i)", value);
- return value;
+lldb::SBData SBData::CreateDataFromUInt32Array(lldb::ByteOrder endian,
+ uint32_t addr_byte_size,
+ uint32_t *array,
+ size_t array_len) {
+ if (!array || array_len == 0)
+ return SBData();
+
+ size_t data_len = array_len * sizeof(uint32_t);
+
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ lldb::DataExtractorSP data_sp(
+ new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+ SBData ret(data_sp);
+
+ return ret;
}
-void
-SBData::SetAddressByteSize (uint8_t addr_byte_size)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (m_opaque_sp.get())
- m_opaque_sp->SetAddressByteSize(addr_byte_size);
- if (log)
- log->Printf ("SBData::SetAddressByteSize (%i)", addr_byte_size);
+lldb::SBData SBData::CreateDataFromSInt64Array(lldb::ByteOrder endian,
+ uint32_t addr_byte_size,
+ int64_t *array,
+ size_t array_len) {
+ if (!array || array_len == 0)
+ return SBData();
+
+ size_t data_len = array_len * sizeof(int64_t);
+
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ lldb::DataExtractorSP data_sp(
+ new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+ SBData ret(data_sp);
+
+ return ret;
}
-void
-SBData::Clear ()
-{
- if (m_opaque_sp.get())
- m_opaque_sp->Clear();
+lldb::SBData SBData::CreateDataFromSInt32Array(lldb::ByteOrder endian,
+ uint32_t addr_byte_size,
+ int32_t *array,
+ size_t array_len) {
+ if (!array || array_len == 0)
+ return SBData();
+
+ size_t data_len = array_len * sizeof(int32_t);
+
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ lldb::DataExtractorSP data_sp(
+ new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+ SBData ret(data_sp);
+
+ return ret;
}
-size_t
-SBData::GetByteSize ()
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- size_t value = 0;
- if (m_opaque_sp.get())
- value = m_opaque_sp->GetByteSize();
- if (log)
- log->Printf ("SBData::GetByteSize () => "
- "( %" PRIu64 " )", (uint64_t)value);
- return value;
-}
-
-lldb::ByteOrder
-SBData::GetByteOrder ()
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- lldb::ByteOrder value = eByteOrderInvalid;
- if (m_opaque_sp.get())
- value = m_opaque_sp->GetByteOrder();
- if (log)
- log->Printf ("SBData::GetByteOrder () => "
- "(%i)", value);
- return value;
+lldb::SBData SBData::CreateDataFromDoubleArray(lldb::ByteOrder endian,
+ uint32_t addr_byte_size,
+ double *array,
+ size_t array_len) {
+ if (!array || array_len == 0)
+ return SBData();
+
+ size_t data_len = array_len * sizeof(double);
+
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ lldb::DataExtractorSP data_sp(
+ new DataExtractor(buffer_sp, endian, addr_byte_size));
+
+ SBData ret(data_sp);
+
+ return ret;
}
-void
-SBData::SetByteOrder (lldb::ByteOrder endian)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (m_opaque_sp.get())
- m_opaque_sp->SetByteOrder(endian);
- if (log)
- log->Printf ("SBData::GetByteOrder (%i)", endian);
-}
-
-
-float
-SBData::GetFloat (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- float value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetFloat(&offset);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => (%f)",
- static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-double
-SBData::GetDouble (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- double value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetDouble(&offset);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => "
- "(%f)", static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-long double
-SBData::GetLongDouble (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- long double value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetLongDouble(&offset);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => "
- "(%Lf)", static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-lldb::addr_t
-SBData::GetAddress (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- lldb::addr_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetAddress(&offset);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => "
- "(%p)", static_cast<void*>(error.get()), offset,
- reinterpret_cast<void*>(value));
- return value;
-}
-
-uint8_t
-SBData::GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- uint8_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetU8(&offset);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => "
- "(%c)", static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-uint16_t
-SBData::GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- uint16_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetU16(&offset);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => "
- "(%hd)", static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-uint32_t
-SBData::GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- uint32_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetU32(&offset);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => "
- "(%d)", static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-uint64_t
-SBData::GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- uint64_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetU64(&offset);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => "
- "(%" PRId64 ")", static_cast<void*>(error.get()), offset,
- value);
- return value;
-}
-
-int8_t
-SBData::GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- int8_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = (int8_t)m_opaque_sp->GetMaxS64(&offset, 1);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => "
- "(%c)", static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-int16_t
-SBData::GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- int16_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = (int16_t)m_opaque_sp->GetMaxS64(&offset, 2);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => "
- "(%hd)", static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-int32_t
-SBData::GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- int32_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = (int32_t)m_opaque_sp->GetMaxS64(&offset, 4);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => "
- "(%d)", static_cast<void*>(error.get()), offset, value);
- return value;
-}
-
-int64_t
-SBData::GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- int64_t value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = (int64_t)m_opaque_sp->GetMaxS64(&offset, 8);
- if (offset == old_offset)
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => "
- "(%" PRId64 ")", static_cast<void*>(error.get()), offset,
- value);
- return value;
-}
-
-const char*
-SBData::GetString (lldb::SBError& error, lldb::offset_t offset)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- const char* value = 0;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- value = m_opaque_sp->GetCStr(&offset);
- if (offset == old_offset || (value == NULL))
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf ("SBData::GetString (error=%p,offset=%" PRIu64 ") => (%p)",
- static_cast<void*>(error.get()), offset,
- static_cast<const void*>(value));
- return value;
-}
-
-bool
-SBData::GetDescription (lldb::SBStream &description, lldb::addr_t base_addr)
-{
- Stream &strm = description.ref();
-
- if (m_opaque_sp)
- {
- m_opaque_sp->Dump (&strm,
- 0,
- lldb::eFormatBytesWithASCII,
- 1,
- m_opaque_sp->GetByteSize(),
- 16,
- base_addr,
- 0,
- 0);
- }
- else
- strm.PutCString ("No value");
-
- return true;
-}
-
-size_t
-SBData::ReadRawData (lldb::SBError& error,
- lldb::offset_t offset,
- void *buf,
- size_t size)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- void* ok = NULL;
- if (!m_opaque_sp.get())
- {
- error.SetErrorString("no value to read from");
- }
- else
- {
- uint32_t old_offset = offset;
- ok = m_opaque_sp->GetU8(&offset, buf, size);
- if ((offset == old_offset) || (ok == NULL))
- error.SetErrorString("unable to read data");
- }
- if (log)
- log->Printf("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%" PRIu64 ") => "
- "(%p)", static_cast<void*>(error.get()), offset,
- static_cast<void*>(buf), static_cast<uint64_t>(size),
- static_cast<void*>(ok));
- return ok ? size : 0;
-}
-
-void
-SBData::SetData (lldb::SBError& error,
- const void *buf,
- size_t size,
- lldb::ByteOrder endian,
- uint8_t addr_size)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- if (!m_opaque_sp.get())
- m_opaque_sp.reset(new DataExtractor(buf, size, endian, addr_size));
- else
- m_opaque_sp->SetData(buf, size, endian);
- if (log)
- log->Printf("SBData::SetData (error=%p,buf=%p,size=%" PRIu64 ",endian=%d,addr_size=%c) => "
- "(%p)", static_cast<void*>(error.get()),
- static_cast<const void*>(buf), static_cast<uint64_t>(size),
- endian, addr_size, static_cast<void*>(m_opaque_sp.get()));
-}
-
-bool
-SBData::Append (const SBData& rhs)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- bool value = false;
- if (m_opaque_sp.get() && rhs.m_opaque_sp.get())
- value = m_opaque_sp.get()->Append(*rhs.m_opaque_sp);
- if (log)
- log->Printf ("SBData::Append (rhs=%p) => (%s)",
- static_cast<void*>(rhs.get()), value ? "true" : "false");
- return value;
-}
-
-lldb::SBData
-SBData::CreateDataFromCString (lldb::ByteOrder endian, uint32_t addr_byte_size, const char* data)
-{
- if (!data || !data[0])
- return SBData();
-
- uint32_t data_len = strlen(data);
-
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
- lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-
- SBData ret(data_sp);
-
- return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromUInt64Array (lldb::ByteOrder endian, uint32_t addr_byte_size, uint64_t* array, size_t array_len)
-{
- if (!array || array_len == 0)
- return SBData();
-
- size_t data_len = array_len * sizeof(uint64_t);
-
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-
- SBData ret(data_sp);
-
- return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromUInt32Array (lldb::ByteOrder endian, uint32_t addr_byte_size, uint32_t* array, size_t array_len)
-{
- if (!array || array_len == 0)
- return SBData();
-
- size_t data_len = array_len * sizeof(uint32_t);
-
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-
- SBData ret(data_sp);
-
- return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromSInt64Array (lldb::ByteOrder endian, uint32_t addr_byte_size, int64_t* array, size_t array_len)
-{
- if (!array || array_len == 0)
- return SBData();
-
- size_t data_len = array_len * sizeof(int64_t);
-
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-
- SBData ret(data_sp);
-
- return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromSInt32Array (lldb::ByteOrder endian, uint32_t addr_byte_size, int32_t* array, size_t array_len)
-{
- if (!array || array_len == 0)
- return SBData();
-
- size_t data_len = array_len * sizeof(int32_t);
-
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-
- SBData ret(data_sp);
-
- return ret;
-}
-
-lldb::SBData
-SBData::CreateDataFromDoubleArray (lldb::ByteOrder endian, uint32_t addr_byte_size, double* array, size_t array_len)
-{
- if (!array || array_len == 0)
- return SBData();
-
- size_t data_len = array_len * sizeof(double);
-
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- lldb::DataExtractorSP data_sp(new DataExtractor(buffer_sp, endian, addr_byte_size));
-
- SBData ret(data_sp);
-
- return ret;
-}
-
-bool
-SBData::SetDataFromCString (const char* data)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
- if (!data)
- {
- if (log)
- log->Printf ("SBData::SetDataFromCString (data=%p) => false",
- static_cast<const void*>(data));
- return false;
- }
-
- size_t data_len = strlen(data);
-
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
-
- if (!m_opaque_sp.get())
- m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
- else
- m_opaque_sp->SetData(buffer_sp);
+bool SBData::SetDataFromCString(const char *data) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (!data) {
if (log)
- log->Printf ("SBData::SetDataFromCString (data=%p) => true",
- static_cast<const void*>(data));
+ log->Printf("SBData::SetDataFromCString (data=%p) => false",
+ static_cast<const void *>(data));
+ return false;
+ }
- return true;
-}
+ size_t data_len = strlen(data);
-bool
-SBData::SetDataFromUInt64Array (uint64_t* array, size_t array_len)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(data, data_len));
- if (!array || array_len == 0)
- {
- if (log)
- log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64 ") => "
- "false", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
- return false;
- }
+ if (!m_opaque_sp.get())
+ m_opaque_sp.reset(
+ new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ else
+ m_opaque_sp->SetData(buffer_sp);
- size_t data_len = array_len * sizeof(uint64_t);
+ if (log)
+ log->Printf("SBData::SetDataFromCString (data=%p) => true",
+ static_cast<const void *>(data));
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ return true;
+}
- if (!m_opaque_sp.get())
- m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
- else
- m_opaque_sp->SetData(buffer_sp);
+bool SBData::SetDataFromUInt64Array(uint64_t *array, size_t array_len) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (!array || array_len == 0) {
if (log)
- log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64 ") => "
- "true", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
+ log->Printf(
+ "SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64
+ ") => "
+ "false",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
+ return false;
+ }
- return true;
-}
+ size_t data_len = array_len * sizeof(uint64_t);
-bool
-SBData::SetDataFromUInt32Array (uint32_t* array, size_t array_len)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- if (!array || array_len == 0)
- {
- if (log)
- log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64 ") => "
- "false", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
- return false;
- }
+ if (!m_opaque_sp.get())
+ m_opaque_sp.reset(
+ new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ else
+ m_opaque_sp->SetData(buffer_sp);
- size_t data_len = array_len * sizeof(uint32_t);
+ if (log)
+ log->Printf("SBData::SetDataFromUInt64Array (array=%p, array_len = %" PRIu64
+ ") => "
+ "true",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ return true;
+}
- if (!m_opaque_sp.get())
- m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
- else
- m_opaque_sp->SetData(buffer_sp);
+bool SBData::SetDataFromUInt32Array(uint32_t *array, size_t array_len) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (!array || array_len == 0) {
if (log)
- log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64 ") => "
- "true", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
+ log->Printf(
+ "SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64
+ ") => "
+ "false",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
+ return false;
+ }
- return true;
-}
+ size_t data_len = array_len * sizeof(uint32_t);
-bool
-SBData::SetDataFromSInt64Array (int64_t* array, size_t array_len)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- if (!array || array_len == 0)
- {
- if (log)
- log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64 ") => "
- "false", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
- return false;
- }
+ if (!m_opaque_sp.get())
+ m_opaque_sp.reset(
+ new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ else
+ m_opaque_sp->SetData(buffer_sp);
- size_t data_len = array_len * sizeof(int64_t);
+ if (log)
+ log->Printf("SBData::SetDataFromUInt32Array (array=%p, array_len = %" PRIu64
+ ") => "
+ "true",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ return true;
+}
- if (!m_opaque_sp.get())
- m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
- else
- m_opaque_sp->SetData(buffer_sp);
+bool SBData::SetDataFromSInt64Array(int64_t *array, size_t array_len) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (!array || array_len == 0) {
if (log)
- log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64 ") => "
- "true", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
+ log->Printf(
+ "SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64
+ ") => "
+ "false",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
+ return false;
+ }
- return true;
-}
+ size_t data_len = array_len * sizeof(int64_t);
-bool
-SBData::SetDataFromSInt32Array (int32_t* array, size_t array_len)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- if (!array || array_len == 0)
- {
- if (log)
- log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64 ") => "
- "false", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
- return false;
- }
+ if (!m_opaque_sp.get())
+ m_opaque_sp.reset(
+ new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ else
+ m_opaque_sp->SetData(buffer_sp);
- size_t data_len = array_len * sizeof(int32_t);
+ if (log)
+ log->Printf("SBData::SetDataFromSInt64Array (array=%p, array_len = %" PRIu64
+ ") => "
+ "true",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ return true;
+}
- if (!m_opaque_sp.get())
- m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
- else
- m_opaque_sp->SetData(buffer_sp);
+bool SBData::SetDataFromSInt32Array(int32_t *array, size_t array_len) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (!array || array_len == 0) {
if (log)
- log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64 ") => "
- "true", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
+ log->Printf(
+ "SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64
+ ") => "
+ "false",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
+ return false;
+ }
- return true;
-}
+ size_t data_len = array_len * sizeof(int32_t);
-bool
-SBData::SetDataFromDoubleArray (double* array, size_t array_len)
-{
- Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
- if (!array || array_len == 0)
- {
- if (log)
- log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64 ") => "
- "false", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
- return false;
- }
+ if (!m_opaque_sp.get())
+ m_opaque_sp.reset(
+ new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ else
+ m_opaque_sp->SetData(buffer_sp);
- size_t data_len = array_len * sizeof(double);
+ if (log)
+ log->Printf("SBData::SetDataFromSInt32Array (array=%p, array_len = %" PRIu64
+ ") => "
+ "true",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
- lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+ return true;
+}
- if (!m_opaque_sp.get())
- m_opaque_sp.reset(new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
- else
- m_opaque_sp->SetData(buffer_sp);
+bool SBData::SetDataFromDoubleArray(double *array, size_t array_len) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ if (!array || array_len == 0) {
if (log)
- log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64 ") => "
- "true", static_cast<void*>(array),
- static_cast<uint64_t>(array_len));
-
- return true;
+ log->Printf(
+ "SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64
+ ") => "
+ "false",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
+ return false;
+ }
+
+ size_t data_len = array_len * sizeof(double);
+
+ lldb::DataBufferSP buffer_sp(new DataBufferHeap(array, data_len));
+
+ if (!m_opaque_sp.get())
+ m_opaque_sp.reset(
+ new DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize()));
+ else
+ m_opaque_sp->SetData(buffer_sp);
+
+ if (log)
+ log->Printf("SBData::SetDataFromDoubleArray (array=%p, array_len = %" PRIu64
+ ") => "
+ "true",
+ static_cast<void *>(array), static_cast<uint64_t>(array_len));
+
+ return true;
}
diff --git a/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index 3493ad507a71..97e6f7b518a5 100644
--- a/source/API/SBDebugger.cpp
+++ b/source/API/SBDebugger.cpp
@@ -15,14 +15,13 @@
#include "lldb/lldb-private.h"
-#include "lldb/API/SystemInitializerFull.h"
-#include "lldb/API/SBListener.h"
#include "lldb/API/SBBroadcaster.h"
#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBError.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBFrame.h"
+#include "lldb/API/SBListener.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBSourceManager.h"
#include "lldb/API/SBStream.h"
@@ -30,11 +29,12 @@
#include "lldb/API/SBTarget.h"
#include "lldb/API/SBThread.h"
#include "lldb/API/SBTypeCategory.h"
-#include "lldb/API/SBTypeFormat.h"
#include "lldb/API/SBTypeFilter.h"
+#include "lldb/API/SBTypeFormat.h"
#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/State.h"
@@ -48,1332 +48,1092 @@
#include "lldb/Target/TargetList.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/ManagedStatic.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DynamicLibrary.h"
+#include "llvm/Support/ManagedStatic.h"
using namespace lldb;
using namespace lldb_private;
-static llvm::sys::DynamicLibrary
-LoadPlugin (const lldb::DebuggerSP &debugger_sp, const FileSpec& spec, Error& error)
-{
- llvm::sys::DynamicLibrary dynlib = llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
- if (dynlib.isValid())
- {
- typedef bool (*LLDBCommandPluginInit) (lldb::SBDebugger& debugger);
-
- lldb::SBDebugger debugger_sb(debugger_sp);
- // This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger) function.
- // TODO: mangle this differently for your system - on OSX, the first underscore needs to be removed and the second one stays
- LLDBCommandPluginInit init_func = (LLDBCommandPluginInit)dynlib.getAddressOfSymbol("_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
- if (init_func)
- {
- if (init_func(debugger_sb))
- return dynlib;
- else
- error.SetErrorString("plug-in refused to load (lldb::PluginInitialize(lldb::SBDebugger) returned false)");
- }
- else
- {
- error.SetErrorString("plug-in is missing the required initialization: lldb::PluginInitialize(lldb::SBDebugger)");
- }
+static llvm::sys::DynamicLibrary LoadPlugin(const lldb::DebuggerSP &debugger_sp,
+ const FileSpec &spec,
+ Error &error) {
+ llvm::sys::DynamicLibrary dynlib =
+ llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
+ if (dynlib.isValid()) {
+ typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger & debugger);
+
+ lldb::SBDebugger debugger_sb(debugger_sp);
+ // This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger)
+ // function.
+ // TODO: mangle this differently for your system - on OSX, the first
+ // underscore needs to be removed and the second one stays
+ LLDBCommandPluginInit init_func =
+ (LLDBCommandPluginInit)dynlib.getAddressOfSymbol(
+ "_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
+ if (init_func) {
+ if (init_func(debugger_sb))
+ return dynlib;
+ else
+ error.SetErrorString("plug-in refused to load "
+ "(lldb::PluginInitialize(lldb::SBDebugger) "
+ "returned false)");
+ } else {
+ error.SetErrorString("plug-in is missing the required initialization: "
+ "lldb::PluginInitialize(lldb::SBDebugger)");
}
+ } else {
+ if (spec.Exists())
+ error.SetErrorString("this file does not represent a loadable dylib");
else
- {
- if (spec.Exists())
- error.SetErrorString("this file does not represent a loadable dylib");
- else
- error.SetErrorString("no such file");
- }
- return llvm::sys::DynamicLibrary();
+ error.SetErrorString("no such file");
+ }
+ return llvm::sys::DynamicLibrary();
}
static llvm::ManagedStatic<SystemLifetimeManager> g_debugger_lifetime;
-SBError
-SBInputReader::Initialize(lldb::SBDebugger &sb_debugger,
- unsigned long (*)(void *, lldb::SBInputReader *, lldb::InputReaderAction, char const *,
- unsigned long),
- void *, lldb::InputReaderGranularity, char const *, char const *, bool)
-{
- return SBError();
+SBError SBInputReader::Initialize(
+ lldb::SBDebugger &sb_debugger,
+ unsigned long (*)(void *, lldb::SBInputReader *, lldb::InputReaderAction,
+ char const *, unsigned long),
+ void *, lldb::InputReaderGranularity, char const *, char const *, bool) {
+ return SBError();
}
-void
-SBInputReader::SetIsDone(bool)
-{
-}
+void SBInputReader::SetIsDone(bool) {}
-bool
-SBInputReader::IsActive() const
-{
- return false;
-}
+bool SBInputReader::IsActive() const { return false; }
SBDebugger::SBDebugger() = default;
-SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp) :
- m_opaque_sp(debugger_sp)
-{
-}
+SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp)
+ : m_opaque_sp(debugger_sp) {}
-SBDebugger::SBDebugger(const SBDebugger &rhs) :
- m_opaque_sp (rhs.m_opaque_sp)
-{
-}
+SBDebugger::SBDebugger(const SBDebugger &rhs) : m_opaque_sp(rhs.m_opaque_sp) {}
SBDebugger::~SBDebugger() = default;
-SBDebugger &
-SBDebugger::operator = (const SBDebugger &rhs)
-{
- if (this != &rhs)
- {
- m_opaque_sp = rhs.m_opaque_sp;
- }
- return *this;
+SBDebugger &SBDebugger::operator=(const SBDebugger &rhs) {
+ if (this != &rhs) {
+ m_opaque_sp = rhs.m_opaque_sp;
+ }
+ return *this;
}