Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java2
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java160
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java4
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java34
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java12
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java22
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java182
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java44
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java22
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java84
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java20
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java4
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java62
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java46
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java36
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java14
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java38
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java10
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java40
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java10
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java58
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java28
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java92
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java12
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java34
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java32
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java40
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java318
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java330
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java14
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java68
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java62
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java30
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java802
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java4
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/ProcessObserver.java52
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/StreamObserver.java82
-rw-r--r--org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java2576
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java178
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java212
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java32
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java98
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java152
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java16
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java68
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java356
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java60
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java6
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java24
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java34
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java8
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java16
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java110
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java20
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java16
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java28
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java32
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java28
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java28
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java24
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java88
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java16
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java26
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java18
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java28
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java12
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java20
-rw-r--r--org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java36
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java104
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java24
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java48
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java34
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java304
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java148
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java176
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTargetFactory.java76
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java98
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistant.java30
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditor.java28
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAScanner.java86
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDASourceViewerConfiguration.java30
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/TextHover.java94
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/WordFinder.java16
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java64
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/presentation/PDAModelPresentation.java106
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/AbstractDataStackViewHandler.java64
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java32
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/DataStackView.java56
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PopHandler.java54
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PushHandler.java18
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java12
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/LocalSuite.java8
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java34
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java2
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/launching/LaunchConfigurationTests.java934
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/DynamicRenderingBindings.java36
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/view/memory/MemoryRenderingTests.java68
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/CheckTests.java80
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ChildrenUpdateTests.java74
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ColumnPresentationTests.java94
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ContentTests.java330
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/DeltaTests.java842
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/FilterTests.java376
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java54
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerCheckTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerContentTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerDeltaTests.java20
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerFilterTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerLazyTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPerformanceTests.java16
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerPopupTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerSelectionTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerStateTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerTopIndexTests.java576
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/JFaceViewerUpdateTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/LazyTests.java262
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PerformanceTests.java390
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PopupTests.java204
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/PresentationContextTests.java22
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/SelectionTests.java292
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/StateTests.java1266
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModel.java1668
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java114
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TreePathWrapper.java68
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/UpdateTests.java796
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerContentTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerDeltaTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerFilterTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerLazyModeTests.java14
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPerformanceTests.java16
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerPopupTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerSelectionTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerStateTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VirtualViewerUpdateTests.java10
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/VisibleVirtualItemValidator.java124
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java512
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java796
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java228
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java176
-rwxr-xr-xorg.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java140
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java250
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java1152
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java116
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java152
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointSortBy/SortBreakpointsByAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java132
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java76
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java160
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointContainer.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointOrganizer.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/IBreakpointUIConstants.java80
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java176
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java112
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultBreakpointsViewInput.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/WatchExpressionCellModifier.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/CommonTabLite.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/hover/DebugTextHover.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/hover/ExpressionInformationControlCreator.java188
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java218
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java240
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java1908
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java146
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java104
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java224
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java196
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java312
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java214
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java142
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java294
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java252
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java108
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java646
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java186
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java138
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java144
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java192
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java230
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/IBreadcrumbDropDownSite.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java392
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java112
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java80
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java524
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java434
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java1428
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java2580
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java964
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java130
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java2010
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java268
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java128
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java146
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java2086
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java242
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java240
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java282
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy2.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java154
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java438
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemListener.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IVirtualItemValidator.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java306
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java252
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewerFilter.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java996
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java332
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java318
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java148
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousContentAdapter.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousLabelAdapter.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IChildrenRequestMonitor.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IContainerRequestMonitor.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ILabelRequestMonitor.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointManagerProxy.java132
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java160
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java410
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java142
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java1210
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java1064
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java136
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java94
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java132
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java370
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java132
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java80
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java116
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java610
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java622
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java100
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java158
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java156
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java116
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java1202
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java454
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java234
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java710
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java226
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java332
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java1272
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java840
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java96
-rwxr-xr-xorg.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java276
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java164
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java318
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/EditVariableLogicalStructureAction.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java214
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java98
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java502
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java276
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java460
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java174
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java224
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane3.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java344
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/BreakpointTypesContribution.java128
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java470
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java394
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetManager.java108
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetManagerListener.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java276
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java172
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/DebugContextEvent.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryBlockTablePresentation.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRendering.java214
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsProvider.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingManager.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSite.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSite2.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSynchronizationService.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingType.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingTypeDelegate.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceLookupResult.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java2
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java516
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java20
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java12
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java2
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java20
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsImages.java2
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java130
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/FileSelectionDialog.java20
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/TreeAndListGroup.java2
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildFilesResolver.java192
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java64
555 files changed, 34343 insertions, 34343 deletions
diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
index 8ddd8ea49..c1dc1f9a0 100644
--- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
+++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
@@ -101,7 +101,7 @@ public class ExternalToolsCoreUtil {
* @throws CoreException if unable to access the associated attribute
*/
public static boolean getCaptureOutput(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, true);
+ return configuration.getAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, true);
}
/**
diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java
index 9ad2ab499..37d7d6fa2 100644
--- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java
+++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java
@@ -65,7 +65,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
private static String buildType = IExternalToolConstants.BUILD_TYPE_NONE;
private static IProject buildProject= null;
- private static IResourceDelta buildDelta= null;
+ private static IResourceDelta buildDelta= null;
@Override
protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
@@ -74,9 +74,9 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
}
ILaunchConfiguration config= BuilderCoreUtils.configFromBuildCommandArgs(getProject(), args, new String[1]);
- if (config == null) {
- throw ExternalToolsCore.newError(ExternalToolsModelMessages.ExternalToolBuilder_0, null);
- }
+ if (config == null) {
+ throw ExternalToolsCore.newError(ExternalToolsModelMessages.ExternalToolBuilder_0, null);
+ }
IProject[] projectsWithinScope= null;
IResource[] resources = ExternalToolsCoreUtil.getResourcesForBuildScope(config);
if (resources != null) {
@@ -85,64 +85,64 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
projectsWithinScope[i]= resources[i].getProject();
}
}
- boolean kindCompatible= commandConfiguredForKind(config, kind);
- if (kindCompatible && configEnabled(config)) {
- doBuildBasedOnScope(resources, kind, config, args, monitor);
- }
+ boolean kindCompatible= commandConfiguredForKind(config, kind);
+ if (kindCompatible && configEnabled(config)) {
+ doBuildBasedOnScope(resources, kind, config, args, monitor);
+ }
return projectsWithinScope;
}
- private boolean commandConfiguredForKind(ILaunchConfiguration config, int kind) {
- try {
- if (!(config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false))) {
- ICommand command= getCommand();
- //adapt the builder command to make use of the 3.1 support for setting command build kinds
- //this will only happen once for builder/command defined before the support existed
- BuilderCoreUtils.configureTriggers(config, command);
- IProjectDescription desc= getProject().getDescription();
- ICommand[] commands= desc.getBuildSpec();
- int index= getBuilderCommandIndex(commands, command);
- if (index != -1) {
- commands[index]= command;
- desc.setBuildSpec(commands);
- getProject().setDescription(desc, null);
- ILaunchConfigurationWorkingCopy copy= config.getWorkingCopy();
- copy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true);
- copy.doSave();
- }
- return command.isBuilding(kind);
- }
- } catch (CoreException e) {
- ExternalToolsCore.log(e);
- return true;
- }
- return true;
- }
+ private boolean commandConfiguredForKind(ILaunchConfiguration config, int kind) {
+ try {
+ if (!(config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false))) {
+ ICommand command= getCommand();
+ //adapt the builder command to make use of the 3.1 support for setting command build kinds
+ //this will only happen once for builder/command defined before the support existed
+ BuilderCoreUtils.configureTriggers(config, command);
+ IProjectDescription desc= getProject().getDescription();
+ ICommand[] commands= desc.getBuildSpec();
+ int index= getBuilderCommandIndex(commands, command);
+ if (index != -1) {
+ commands[index]= command;
+ desc.setBuildSpec(commands);
+ getProject().setDescription(desc, null);
+ ILaunchConfigurationWorkingCopy copy= config.getWorkingCopy();
+ copy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true);
+ copy.doSave();
+ }
+ return command.isBuilding(kind);
+ }
+ } catch (CoreException e) {
+ ExternalToolsCore.log(e);
+ return true;
+ }
+ return true;
+ }
- private int getBuilderCommandIndex(ICommand[] buildSpec, ICommand command) {
+ private int getBuilderCommandIndex(ICommand[] buildSpec, ICommand command) {
Map<String, String> commandArgs = command.getArguments();
- if (commandArgs == null) {
- return -1;
- }
- String handle= commandArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE);
- if (handle == null) {
- return -1;
- }
- for (int i = 0; i < buildSpec.length; ++i) {
- ICommand buildSpecCommand= buildSpec[i];
- if (ID.equals(buildSpecCommand.getBuilderName())) {
+ if (commandArgs == null) {
+ return -1;
+ }
+ String handle= commandArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE);
+ if (handle == null) {
+ return -1;
+ }
+ for (int i = 0; i < buildSpec.length; ++i) {
+ ICommand buildSpecCommand= buildSpec[i];
+ if (ID.equals(buildSpecCommand.getBuilderName())) {
Map<String, String> buildSpecArgs = buildSpecCommand.getArguments();
- if (buildSpecArgs != null) {
- String buildSpecHandle= buildSpecArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE);
- if (handle.equals(buildSpecHandle)) {
- return i;
- }
- }
- }
- }
- return -1;
- }
+ if (buildSpecArgs != null) {
+ String buildSpecHandle= buildSpecArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE);
+ if (handle.equals(buildSpecHandle)) {
+ return i;
+ }
+ }
+ }
+ }
+ return -1;
+ }
/**
* Returns whether the given builder config is enabled or not.
@@ -204,15 +204,15 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
return buildProject;
}
- /**
- * Returns the <code>IResourceDelta</code> that is being built and has triggered the current external
- * tool builder. <code>null</code> is returned if no build is currently occurring.
- *
- * @return resource delta for the build or <code>null</code>
- */
- public static IResourceDelta getBuildDelta() {
- return buildDelta;
- }
+ /**
+ * Returns the <code>IResourceDelta</code> that is being built and has triggered the current external
+ * tool builder. <code>null</code> is returned if no build is currently occurring.
+ *
+ * @return resource delta for the build or <code>null</code>
+ */
+ public static IResourceDelta getBuildDelta() {
+ return buildDelta;
+ }
/**
* Stores the currently active build kind and build project when a build begins
@@ -238,9 +238,9 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
buildType = IExternalToolConstants.BUILD_TYPE_AUTO;
buildDelta = getDelta(getProject());
break;
- case IncrementalProjectBuilder.CLEAN_BUILD :
- buildType = IExternalToolConstants.BUILD_TYPE_CLEAN;
- break;
+ case IncrementalProjectBuilder.CLEAN_BUILD :
+ buildType = IExternalToolConstants.BUILD_TYPE_CLEAN;
+ break;
default :
buildType = IExternalToolConstants.BUILD_TYPE_NONE;
break;
@@ -254,7 +254,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
private void buildEnded() {
buildType= IExternalToolConstants.BUILD_TYPE_NONE;
buildProject= null;
- buildDelta= null;
+ buildDelta= null;
}
private boolean buildScopeIndicatesBuild(IResource[] resources) {
@@ -281,20 +281,20 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
return false;
}
- @Override
+ @Override
protected void clean(IProgressMonitor monitor) throws CoreException {
- ICommand command= getCommand();
- ILaunchConfiguration config= BuilderCoreUtils.configFromBuildCommandArgs(getProject(), command.getArguments(), new String[1]);
- if (!configEnabled(config)) {
- return;
- }
+ ICommand command= getCommand();
+ ILaunchConfiguration config= BuilderCoreUtils.configFromBuildCommandArgs(getProject(), command.getArguments(), new String[1]);
+ if (!configEnabled(config)) {
+ return;
+ }
- if ((!config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false))) {
- //old behavior
- super.clean(monitor);
- return;
- }
+ if ((!config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false))) {
+ //old behavior
+ super.clean(monitor);
+ return;
+ }
launchBuild(IncrementalProjectBuilder.CLEAN_BUILD, config, null, monitor);
- }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java
index c9918df00..de6959f19 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java
@@ -53,9 +53,9 @@ public class DynamicVariable extends StringVariable implements IDynamicVariable
}
}
try {
- return fResolver.resolveValue(this, argument);
+ return fResolver.resolveValue(this, argument);
} catch (RuntimeException e) {
- throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Error while evaluating variable {0}.",new String[]{getName()}), e)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Error while evaluating variable {0}.",new String[]{getName()}), e)); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java
index eefb3845f..ffbeadbcd 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java
@@ -33,27 +33,27 @@ public class EclipseHomeVariableResolver implements IDynamicVariableResolver {
@Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
- Location installLocation = Platform.getInstallLocation();
- if (installLocation != null) {
- URL url = installLocation.getURL();
- if (url != null) {
+ Location installLocation = Platform.getInstallLocation();
+ if (installLocation != null) {
+ URL url = installLocation.getURL();
+ if (url != null) {
// Try to convert the URL to an OS string, to be consistent with
// how other variables, like ${workspace_loc} resolve. See
// ResourceResolver.translateToValue(). [bugzilla 263535]
- String file = url.getFile();
- IPath path = Path.fromOSString(file);
- String osstr = path.toOSString();
- if (osstr.length() != 0) {
- return osstr;
- }
+ String file = url.getFile();
+ IPath path = Path.fromOSString(file);
+ String osstr = path.toOSString();
+ if (osstr.length() != 0) {
+ return osstr;
+ }
- if (file.length() != 0) {
- return file;
- }
- }
- }
- return null;
- }
+ if (file.length() != 0) {
+ return file;
+ }
+ }
+ }
+ return null;
+ }
}
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
index e0013b526..fa980503a 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
@@ -558,13 +558,13 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
new StringSubstitutionEngine().validateStringVariables(expression, this);
}
- @Override
+ @Override
public String getContributingPluginId(IStringVariable variable) {
- if (variable instanceof StringVariable) {
- return ((StringVariable) variable).getConfigurationElement().getContributor().getName();
- }
- return null;
- }
+ if (variable instanceof StringVariable) {
+ return ((StringVariable) variable).getConfigurationElement().getContributor().getName();
+ }
+ return null;
+ }
@Override
public void preferenceChange(PreferenceChangeEvent event) {
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
index db0ffb833..1731d14ac 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java
@@ -75,17 +75,17 @@ public interface IStringVariableManager {
*/
IDynamicVariable getDynamicVariable(String name);
- /**
- * Returns the plug-in identifier of the plug-in that contributed the
- * given variable via extension or <code>null</code> if the given
- * variable wasn't contributed via extension.
- *
- * @param variable the variable
- * @return the plug-in identifier of the plug-in that contributed the
- * given variable or <code>null</code>
- * @since 3.1
- */
- String getContributingPluginId(IStringVariable variable);
+ /**
+ * Returns the plug-in identifier of the plug-in that contributed the
+ * given variable via extension or <code>null</code> if the given
+ * variable wasn't contributed via extension.
+ *
+ * @param variable the variable
+ * @return the plug-in identifier of the plug-in that contributed the
+ * given variable or <code>null</code>
+ * @since 3.1
+ */
+ String getContributingPluginId(IStringVariable variable);
/**
* Recursively resolves and replaces all variable references in the given
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
index 313d3218e..534b5a79b 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
@@ -154,10 +154,10 @@ import org.eclipse.debug.internal.core.DebugCoreMessages;
*/
public final class DebugEvent extends EventObject {
- /**
- * All objects that can be serialized should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
+ /**
+ * All objects that can be serialized should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
/**
* Resume event kind.
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java
index c913ea4a3..cd3a23d3d 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java
@@ -32,10 +32,10 @@ import org.eclipse.core.runtime.IStatus;
*/
public class DebugException extends CoreException {
- /**
- * All objects that can be serialized should have a stable serialVersionUID
- */
- private static final long serialVersionUID = 1L;
+ /**
+ * All objects that can be serialized should have a stable serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
/**
* Indicates a request made of a debug element has failed
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
index 53d6db5c2..b1d681ee0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
@@ -276,21 +276,21 @@ public class DebugPlugin extends Plugin {
*/
public static final String ATTR_LAUNCH_TIMESTAMP = PI_DEBUG_CORE + ".launch.timestamp"; //$NON-NLS-1$
- /**
- * This launch attribute designates the encoding to be used by the console
- * associated with the launch.
- * <p>
- * For release 3.3, the system encoding is used when unspecified. Since 3.4,
- * the inherited encoding is used when unspecified. See {@link ILaunchManager} for a
- * description in <code>getEncoding(ILaunchConfiguration)</code>.
- * </p>
- * <p>
- * Value of this constant is the same as the value of the old
- * <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code> constant for backward
- * compatibility.
- * </p>
- * @since 3.3
- */
+ /**
+ * This launch attribute designates the encoding to be used by the console
+ * associated with the launch.
+ * <p>
+ * For release 3.3, the system encoding is used when unspecified. Since 3.4,
+ * the inherited encoding is used when unspecified. See {@link ILaunchManager} for a
+ * description in <code>getEncoding(ILaunchConfiguration)</code>.
+ * </p>
+ * <p>
+ * Value of this constant is the same as the value of the old
+ * <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code> constant for backward
+ * compatibility.
+ * </p>
+ * @since 3.3
+ */
public static final String ATTR_CONSOLE_ENCODING = "org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING"; //$NON-NLS-1$
/**
@@ -419,43 +419,43 @@ public class DebugPlugin extends Plugin {
EventNotifier fNotifier = new EventNotifier();
AsynchRunner fRunner = new AsynchRunner();
- /**
- * Creates a new event dispatch job.
- */
- public EventDispatchJob() {
- super(DebugCoreMessages.DebugPlugin_1);
- setPriority(Job.INTERACTIVE);
- setSystem(true);
- }
+ /**
+ * Creates a new event dispatch job.
+ */
+ public EventDispatchJob() {
+ super(DebugCoreMessages.DebugPlugin_1);
+ setPriority(Job.INTERACTIVE);
+ setSystem(true);
+ }
- @Override
+ @Override
protected IStatus run(IProgressMonitor monitor) {
- while (!fEventQueue.isEmpty()) {
- Object next = null;
- synchronized (fEventQueue) {
- if (!fEventQueue.isEmpty()) {
- next = fEventQueue.remove(0);
- }
- }
- if (next instanceof Runnable) {
- fRunner.async((Runnable) next);
- } else if (next != null) {
- fNotifier.dispatch((DebugEvent[]) next);
- }
- }
- return Status.OK_STATUS;
- }
-
- @Override
+ while (!fEventQueue.isEmpty()) {
+ Object next = null;
+ synchronized (fEventQueue) {
+ if (!fEventQueue.isEmpty()) {
+ next = fEventQueue.remove(0);
+ }
+ }
+ if (next instanceof Runnable) {
+ fRunner.async((Runnable) next);
+ } else if (next != null) {
+ fNotifier.dispatch((DebugEvent[]) next);
+ }
+ }
+ return Status.OK_STATUS;
+ }
+
+ @Override
public boolean shouldRun() {
- return shouldSchedule();
- }
+ return shouldSchedule();
+ }
- @Override
+ @Override
public boolean shouldSchedule() {
- return !(isShuttingDown() || fEventListeners.isEmpty());
- }
+ return !(isShuttingDown() || fEventListeners.isEmpty());
+ }
}
@@ -662,7 +662,7 @@ public class DebugPlugin extends Plugin {
}
fEventListeners.clear();
- fEventFilters.clear();
+ fEventFilters.clear();
SourceLookupUtils.shutdown();
Preferences.savePreferences(DebugPlugin.getUniqueIdentifier());
@@ -796,37 +796,37 @@ public class DebugPlugin extends Plugin {
return LogicalStructureManager.getDefault().getLogicalStructureTypes(value);
}
- /**
- * Returns the default logical structure type among the given combination of
- * logical structure types, or <code>null</code> if none. When the given combination
- * of logical structure type is applicable for a value, the default logical structure
- * type is used to display a value.
- *
- * @param types a combination of structures applicable to a value
- * @return the default structure that should be used to display the value
- * or <code>null</code> if none
- *
- * @since 3.1
- */
- public static ILogicalStructureType getDefaultStructureType(ILogicalStructureType[] types) {
- return LogicalStructureManager.getDefault().getSelectedStructureType(types);
- }
-
- /**
- * Sets the default logical structure type among the given combination of logical structure
- * types. The logical structure types provided should all be applicable to a single
- * value. Specifying <code>null</code> indicates there is no default logical structure
- * for the given combination of types.
- *
- * @param types a combination of logical structure types applicable to a value
- * @param def the default logical structure among the given combination of types
- * or <code>null</code> if none
- *
- * @since 3.1
- */
- public static void setDefaultStructureType(ILogicalStructureType[] types, ILogicalStructureType def) {
- LogicalStructureManager.getDefault().setEnabledType(types, def);
- }
+ /**
+ * Returns the default logical structure type among the given combination of
+ * logical structure types, or <code>null</code> if none. When the given combination
+ * of logical structure type is applicable for a value, the default logical structure
+ * type is used to display a value.
+ *
+ * @param types a combination of structures applicable to a value
+ * @return the default structure that should be used to display the value
+ * or <code>null</code> if none
+ *
+ * @since 3.1
+ */
+ public static ILogicalStructureType getDefaultStructureType(ILogicalStructureType[] types) {
+ return LogicalStructureManager.getDefault().getSelectedStructureType(types);
+ }
+
+ /**
+ * Sets the default logical structure type among the given combination of logical structure
+ * types. The logical structure types provided should all be applicable to a single
+ * value. Specifying <code>null</code> indicates there is no default logical structure
+ * for the given combination of types.
+ *
+ * @param types a combination of logical structure types applicable to a value
+ * @param def the default logical structure among the given combination of types
+ * or <code>null</code> if none
+ *
+ * @since 3.1
+ */
+ public static void setDefaultStructureType(ILogicalStructureType[] types, ILogicalStructureType def) {
+ LogicalStructureManager.getDefault().setEnabledType(types, def);
+ }
/**
* Convenience method that performs a runtime exec on the given command line
@@ -876,8 +876,8 @@ public class DebugPlugin extends Plugin {
p= Runtime.getRuntime().exec(cmdLine, envp, workingDirectory);
}
} catch (IOException e) {
- Status status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_0, e);
- throw new CoreException(status);
+ Status status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_0, e);
+ throw new CoreException(status);
} catch (NoSuchMethodError e) {
//attempting launches on 1.2.* - no ability to set working directory
IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERR_WORKING_DIRECTORY_NOT_SUPPORTED, DebugCoreMessages.DebugPlugin_Eclipse_runtime_does_not_support_working_directory_2, e);
@@ -1165,7 +1165,7 @@ public class DebugPlugin extends Plugin {
}
for (IDebugEventSetListener iDebugEventSetListener : fEventListeners) {
fListener = iDebugEventSetListener;
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
fEvents = null;
fFilter = null;
@@ -1236,9 +1236,9 @@ public class DebugPlugin extends Plugin {
abort("Unable to parse XML document.", e); //$NON-NLS-1$
} finally {
try{
- if (stream != null) {
- stream.close();
- }
+ if (stream != null) {
+ stream.close();
+ }
} catch(IOException e) {
abort("Unable to parse XML document.", e); //$NON-NLS-1$
}
@@ -1651,25 +1651,25 @@ public class DebugPlugin extends Plugin {
* @since 3.4
*/
public static Object getAdapter(Object element, Class<?> type) {
- Object adapter = null;
- if (element != null) {
- if (type.isInstance(element)) {
+ Object adapter = null;
+ if (element != null) {
+ if (type.isInstance(element)) {
return element;
} else {
if (element instanceof IAdaptable) {
- adapter = ((IAdaptable)element).getAdapter(type);
+ adapter = ((IAdaptable)element).getAdapter(type);
}
// for objects that don't subclass PlatformObject, check the platform's adapter manager
if (adapter == null && !(element instanceof PlatformObject)) {
- adapter = Platform.getAdapterManager().getAdapter(element, type);
+ adapter = Platform.getAdapterManager().getAdapter(element, type);
}
// force load the adapter in case it really is available
if (adapter == null) {
adapter = Platform.getAdapterManager().loadAdapter(element, type.getName());
}
}
- }
- return adapter;
+ }
+ return adapter;
}
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
index 4228c4f93..892c97fee 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java
@@ -241,28 +241,28 @@ public interface IBreakpointManager {
*/
void setEnabled(boolean enabled);
- /**
- * Returns the name (user readable String) of the given
- * breakpoint's type or <code>null</code> if none has been
- * specified.
- *
- * @param breakpoint the breakpoint
- * @return the name of the given breakpoint's type or <code>null</code>
- * @since 3.1
- */
- String getTypeName(IBreakpoint breakpoint);
-
- /**
- * Returns an array of {@link IBreakpointImportParticipant}s for the given
- * breakpoint marker id, never <code>null</code>.
- *
- * @param markertype the {@link String} identifier of the marker type
- * @return an array of {@link IBreakpointImportParticipant}s for the given marker type,
- * never <code>null</code>
- * @throws CoreException if an exception occurs
- * @since 3.5
- */
- IBreakpointImportParticipant[] getImportParticipants(String markertype) throws CoreException;
+ /**
+ * Returns the name (user readable String) of the given
+ * breakpoint's type or <code>null</code> if none has been
+ * specified.
+ *
+ * @param breakpoint the breakpoint
+ * @return the name of the given breakpoint's type or <code>null</code>
+ * @since 3.1
+ */
+ String getTypeName(IBreakpoint breakpoint);
+
+ /**
+ * Returns an array of {@link IBreakpointImportParticipant}s for the given
+ * breakpoint marker id, never <code>null</code>.
+ *
+ * @param markertype the {@link String} identifier of the marker type
+ * @return an array of {@link IBreakpointImportParticipant}s for the given marker type,
+ * never <code>null</code>
+ * @throws CoreException if an exception occurs
+ * @since 3.5
+ */
+ IBreakpointImportParticipant[] getImportParticipants(String markertype) throws CoreException;
/**
* Returns the triggers for the breakpoints associated with the workspace or
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java
index 6734919ee..461131954 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java
@@ -156,17 +156,17 @@ public interface IExpressionManager {
*/
IWatchExpressionDelegate newWatchExpressionDelegate(String id);
- /**
- * Returns whether a watch expression delegate has been contributed for
- * the given debug model.
- *
- * @param id the unique identifier of a debug model
- * @return whether a watch expression delegate has been contributed for
- * the given debug model
- * @since 3.1
- * @see IWatchExpressionDelegate
- */
- boolean hasWatchExpressionDelegate(String id);
+ /**
+ * Returns whether a watch expression delegate has been contributed for
+ * the given debug model.
+ *
+ * @param id the unique identifier of a debug model
+ * @return whether a watch expression delegate has been contributed for
+ * the given debug model
+ * @since 3.1
+ * @see IWatchExpressionDelegate
+ */
+ boolean hasWatchExpressionDelegate(String id);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java
index 827697b32..d220503fc 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java
@@ -37,51 +37,51 @@ import org.eclipse.core.runtime.IStatus;
*/
public interface IRequest {
- /**
- * Sets the status for this request indicating whether this request
- * succeeded, failed, or was canceled. When a request fails, the status
- * indicates why the request failed. A <code>null</code> status is considered
- * to be successful. Only clients fulfilling a request should call this
- * method. Clients making a request are not intended to call this method.
- *
- * @param status request status or <code>null</code>
- */
- void setStatus(IStatus status);
+ /**
+ * Sets the status for this request indicating whether this request
+ * succeeded, failed, or was canceled. When a request fails, the status
+ * indicates why the request failed. A <code>null</code> status is considered
+ * to be successful. Only clients fulfilling a request should call this
+ * method. Clients making a request are not intended to call this method.
+ *
+ * @param status request status or <code>null</code>
+ */
+ void setStatus(IStatus status);
- /**
- * Returns the status of this request, or <code>null</code>.
- *
- * @return request status - <code>null</code> is equivalent
- * to an OK status
- */
- IStatus getStatus();
+ /**
+ * Returns the status of this request, or <code>null</code>.
+ *
+ * @return request status - <code>null</code> is equivalent
+ * to an OK status
+ */
+ IStatus getStatus();
- /**
- * Indicates this request is complete. Clients must call this method
- * whether the request succeeds, fails, or is cancelled to indicate that
- * processing is complete. Only clients fulfilling a request should call this
- * method. Clients making a request are not intended to call this method.
- */
- void done();
+ /**
+ * Indicates this request is complete. Clients must call this method
+ * whether the request succeeds, fails, or is cancelled to indicate that
+ * processing is complete. Only clients fulfilling a request should call this
+ * method. Clients making a request are not intended to call this method.
+ */
+ void done();
- /**
- * Cancels this request. A request may be canceled by the originator of request
- * or a client fulfilling a request. Optionally a canceled status may be set on
- * this request with more details. A client fulfilling a request must still call
- * <code>done()</code> to indicate the request is complete.
- */
- void cancel();
+ /**
+ * Cancels this request. A request may be canceled by the originator of request
+ * or a client fulfilling a request. Optionally a canceled status may be set on
+ * this request with more details. A client fulfilling a request must still call
+ * <code>done()</code> to indicate the request is complete.
+ */
+ void cancel();
- /**
- * Returns whether this request has been canceled.
- * <p>
- * Clients fulfilling a request are expected to poll a request (using <code>isCanceled</code>)
- * periodically and abort at their earliest convenience calling <code>done()</code>.
- * A request can be canceled by the originator of the request or a processor fulfilling a
- * request.
- * </p>
- * @return whether this request has been canceled
- */
- boolean isCanceled();
+ /**
+ * Returns whether this request has been canceled.
+ * <p>
+ * Clients fulfilling a request are expected to poll a request (using <code>isCanceled</code>)
+ * periodically and abort at their earliest convenience calling <code>done()</code>.
+ * A request can be canceled by the originator of the request or a processor fulfilling a
+ * request.
+ * </p>
+ * @return whether this request has been canceled
+ */
+ boolean isCanceled();
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
index fad75de0f..0f2cf17a3 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
@@ -493,9 +493,9 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
}
/**
- * Returns whether any processes or targets can be disconnected.
- * Ones that are already terminated or disconnected are ignored.
- *
+ * Returns whether any processes or targets can be disconnected.
+ * Ones that are already terminated or disconnected are ignored.
+ *
* @see org.eclipse.debug.core.model.IDisconnect#canDisconnect()
*/
@Override
@@ -517,7 +517,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
} finally {
readLock.unlock();
}
- return false;
+ return false;
}
/**
@@ -546,10 +546,10 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
}
/**
- * Returns whether all of the contained targets and processes are
- * disconnected. Processes that don't support disconnecting are not
- * counted.
- *
+ * Returns whether all of the contained targets and processes are
+ * disconnected. Processes that don't support disconnecting are not
+ * counted.
+ *
* @see org.eclipse.debug.core.model.IDisconnect#isDisconnected()
*/
@Override
@@ -571,8 +571,8 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
} finally {
readLock.unlock();
}
- // only return true if there are processes or targets that are disconnected
- return hasChildren();
+ // only return true if there are processes or targets that are disconnected
+ return hasChildren();
}
@Override
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java
index 0bc82a904..15b204aad 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java
@@ -166,7 +166,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
/**
* Scheduling rule to serialize commands on an object
*/
- private class SerialPerObjectRule implements ISchedulingRule {
+ private class SerialPerObjectRule implements ISchedulingRule {
private Object fObject = null;
@@ -326,7 +326,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
* @return adapter or <code>null</code>
*/
protected Object getAdapter(Object element, Class<?> type) {
- return DebugPlugin.getAdapter(element, type);
+ return DebugPlugin.getAdapter(element, type);
}
/**
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
index b31cb9280..ef7c44ebf 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
@@ -346,14 +346,14 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint,
* possibly <code>null</code>
* @since 3.1
*/
- protected ISchedulingRule getMarkerRule(IResource resource) {
- ISchedulingRule rule = null;
- if (resource != null) {
- IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
- rule = ruleFactory.markerRule(resource);
- }
- return rule;
- }
+ protected ISchedulingRule getMarkerRule(IResource resource) {
+ ISchedulingRule rule = null;
+ if (resource != null) {
+ IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
+ rule = ruleFactory.markerRule(resource);
+ }
+ return rule;
+ }
/**
* Returns a scheduling rule to use when modifying or deleting this breakpoint's marker,
@@ -364,34 +364,34 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint,
* @return a scheduling rule to use when modifying or deleting this breakpoint's marker
* @since 3.1
*/
- protected ISchedulingRule getMarkerRule() {
- ISchedulingRule rule = null;
- IMarker marker = getMarker();
- if (marker != null) {
- IResource resource = marker.getResource();
- if (resource != null) {
- IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
- rule = ruleFactory.markerRule(resource);
- }
- }
- return rule;
- }
-
- /**
+ protected ISchedulingRule getMarkerRule() {
+ ISchedulingRule rule = null;
+ IMarker marker = getMarker();
+ if (marker != null) {
+ IResource resource = marker.getResource();
+ if (resource != null) {
+ IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
+ rule = ruleFactory.markerRule(resource);
+ }
+ }
+ return rule;
+ }
+
+ /**
* Execute the given workspace runnable with the scheduling rule to use when running the operation.
*
* @param rule the rule to use when running the operation
- * @param wr the runnable operation
- * @throws DebugException If a core exception occurs performing the operation
+ * @param wr the runnable operation
+ * @throws DebugException If a core exception occurs performing the operation
* @since 3.1
*/
- protected void run(ISchedulingRule rule, IWorkspaceRunnable wr) throws DebugException {
- try {
- ResourcesPlugin.getWorkspace().run(wr, rule, IWorkspace.AVOID_UPDATE, null);
- } catch (CoreException e) {
- throw new DebugException(e.getStatus());
- }
- }
+ protected void run(ISchedulingRule rule, IWorkspaceRunnable wr) throws DebugException {
+ try {
+ ResourcesPlugin.getWorkspace().run(wr, rule, IWorkspace.AVOID_UPDATE, null);
+ } catch (CoreException e) {
+ throw new DebugException(e.getStatus());
+ }
+ }
@Override
public String toString() {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java
index 38bcb82dd..d8be9a753 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java
@@ -31,27 +31,27 @@ import org.eclipse.debug.core.ILaunchConfiguration;
*/
public abstract class DebugElement extends PlatformObject implements IDebugElement {
- private IDebugTarget fTarget;
-
- /**
- * Constructs a debug element referring to an artifact in the given
- * debug target.
- *
- * @param target debug target containing this element
- */
- public DebugElement(IDebugTarget target) {
- fTarget = target;
- }
-
- @Override
+ private IDebugTarget fTarget;
+
+ /**
+ * Constructs a debug element referring to an artifact in the given
+ * debug target.
+ *
+ * @param target debug target containing this element
+ */
+ public DebugElement(IDebugTarget target) {
+ fTarget = target;
+ }
+
+ @Override
public IDebugTarget getDebugTarget() {
- return fTarget;
- }
+ return fTarget;
+ }
- @Override
+ @Override
public ILaunch getLaunch() {
- return getDebugTarget().getLaunch();
- }
+ return getDebugTarget().getLaunch();
+ }
@SuppressWarnings("unchecked")
@Override
@@ -80,7 +80,7 @@ public abstract class DebugElement extends PlatformObject implements IDebugEleme
return (T) getLaunch().getLaunchConfiguration();
}
return super.getAdapter(adapter);
- }
+ }
/**
* Fires a debug event.
@@ -105,7 +105,7 @@ public abstract class DebugElement extends PlatformObject implements IDebugEleme
/**
* Fires a creation event for this debug element.
*/
- public void fireCreationEvent() {
+ public void fireCreationEvent() {
fireEvent(new DebugEvent(this, DebugEvent.CREATE));
}
@@ -116,7 +116,7 @@ public abstract class DebugElement extends PlatformObject implements IDebugEleme
* @param detail detail code for the resume event, such
* as <code>DebugEvent.STEP_OVER</code>
*/
- public void fireResumeEvent(int detail) {
+ public void fireResumeEvent(int detail) {
fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail));
}
@@ -127,14 +127,14 @@ public abstract class DebugElement extends PlatformObject implements IDebugEleme
* @param detail detail code for the suspend event, such
* as <code>DebugEvent.BREAKPOINT</code>
*/
- public void fireSuspendEvent(int detail) {
+ public void fireSuspendEvent(int detail) {
fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail));
}
/**
* Fires a terminate event for this debug element.
*/
- public void fireTerminateEvent() {
+ public void fireTerminateEvent() {
fireEvent(new DebugEvent(this, DebugEvent.TERMINATE));
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java
index 1ac3b6230..d207d5f3a 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java
@@ -24,23 +24,23 @@ import org.eclipse.debug.core.DebugException;
*/
public interface IDropToFrame {
- /**
- * Returns whether this element can currently perform a drop to frame.
- * @return whether this element can currently perform a drop to frame
- */
- boolean canDropToFrame();
+ /**
+ * Returns whether this element can currently perform a drop to frame.
+ * @return whether this element can currently perform a drop to frame
+ */
+ boolean canDropToFrame();
- /**
- * Performs a drop to frame on this element. Implementations must generate
- * events such that debug clients can update appropriately, such as corresponding
- * <code>RESUME</code> and <code>SUSPEND</code> events, or a single <code>CHANGE</code>
- * event when the drop is complete. Implementations should implement drop to frame
- * in a non-blocking fashion.
- *
- * @throws DebugException on failure. Reasons include:<ul>
- * <li>TARGET_REQUEST_FAILED - The request failed in the target</li>
- * <li>NOT_SUPPORTED - The capability is not supported by the target</li>
- * </ul>
- */
- void dropToFrame() throws DebugException;
+ /**
+ * Performs a drop to frame on this element. Implementations must generate
+ * events such that debug clients can update appropriately, such as corresponding
+ * <code>RESUME</code> and <code>SUSPEND</code> events, or a single <code>CHANGE</code>
+ * event when the drop is complete. Implementations should implement drop to frame
+ * in a non-blocking fashion.
+ *
+ * @throws DebugException on failure. Reasons include:<ul>
+ * <li>TARGET_REQUEST_FAILED - The request failed in the target</li>
+ * <li>NOT_SUPPORTED - The capability is not supported by the target</li>
+ * </ul>
+ */
+ void dropToFrame() throws DebugException;
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java
index ec2b81005..35f5eb121 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java
@@ -27,11 +27,11 @@ import java.io.IOException;
*/
public interface IStreamsProxy2 extends IStreamsProxy {
- /**
- * Closes the output stream connected to the standard input stream
- * of this proxy's process.
- *
- * @throws IOException if unable to close the stream
- */
- void closeInputStream() throws IOException;
+ /**
+ * Closes the output stream connected to the standard input stream
+ * of this proxy's process.
+ *
+ * @throws IOException if unable to close the stream
+ */
+ void closeInputStream() throws IOException;
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java
index 898a04197..18b6b4131 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java
@@ -209,9 +209,9 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
}
if (mode.equals(ILaunchManager.RUN_MODE) && configuration.supportsMode(ILaunchManager.DEBUG_MODE)) {
IBreakpoint[] breakpoints= getBreakpoints(configuration);
- if (breakpoints == null) {
- return true;
- }
+ if (breakpoints == null) {
+ return true;
+ }
for (int i = 0; i < breakpoints.length; i++) {
if (breakpoints[i].isEnabled()) {
IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus);
@@ -262,22 +262,22 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
}
}
- /**
- * Returns the breakpoint collection that is relevant for this launch delegate.
- * By default this is all the breakpoints registered with the Debug breakpoint manager.
- *
- * @param configuration the configuration to get associated breakpoints for
- * @since 3.1
- * @return the breakpoints that are relevant for this launch delegate
- */
- protected IBreakpoint[] getBreakpoints(ILaunchConfiguration configuration) {
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- if (!breakpointManager.isEnabled()) {
- // no need to check breakpoints individually.
- return null;
- }
- return breakpointManager.getBreakpoints();
- }
+ /**
+ * Returns the breakpoint collection that is relevant for this launch delegate.
+ * By default this is all the breakpoints registered with the Debug breakpoint manager.
+ *
+ * @param configuration the configuration to get associated breakpoints for
+ * @since 3.1
+ * @return the breakpoints that are relevant for this launch delegate
+ */
+ protected IBreakpoint[] getBreakpoints(ILaunchConfiguration configuration) {
+ IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
+ if (!breakpointManager.isEnabled()) {
+ // no need to check breakpoints individually.
+ return null;
+ }
+ return breakpointManager.getBreakpoints();
+ }
/**
* Returns an array of projects in their suggested build order
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java
index 829ebf1eb..16c8c2148 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java
@@ -27,9 +27,9 @@ package org.eclipse.debug.core.model;
*/
public class MemoryByte {
- /**
- * Bit mask used to indicate a byte is writable.
- */
+ /**
+ * Bit mask used to indicate a byte is writable.
+ */
public static final byte WRITABLE = 0x01;
/**
@@ -88,7 +88,7 @@ public class MemoryByte {
* by default.
*/
public MemoryByte() {
- this((byte)0, (byte)(WRITABLE | READABLE | ENDIANESS_KNOWN));
+ this((byte)0, (byte)(WRITABLE | READABLE | ENDIANESS_KNOWN));
}
/**
@@ -100,7 +100,7 @@ public class MemoryByte {
*
*/
public MemoryByte(byte byteValue) {
- this(byteValue, (byte)(WRITABLE | READABLE | ENDIANESS_KNOWN));
+ this(byteValue, (byte)(WRITABLE | READABLE | ENDIANESS_KNOWN));
}
/**
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java
index d34a62320..9f56edef5 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java
@@ -203,12 +203,12 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
}
Process process = getSystemProcess();
if (process != null) {
- process.destroy();
+ process.destroy();
}
int attempts = 0;
while (attempts < MAX_WAIT_FOR_DEATH_ATTEMPTS) {
try {
- process = getSystemProcess();
+ process = getSystemProcess();
if (process != null) {
fExitValue = process.exitValue(); // throws exception if process not exited
}
@@ -236,24 +236,24 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
* has terminated.
*/
protected void terminated() {
- if (fStreamsProxy instanceof StreamsProxy) {
- ((StreamsProxy)fStreamsProxy).close();
- }
+ if (fStreamsProxy instanceof StreamsProxy) {
+ ((StreamsProxy)fStreamsProxy).close();
+ }
- // Avoid calling IProcess.exitValue() inside a sync section (Bug 311813).
- int exitValue = -1;
- boolean running = false;
- try {
- exitValue = fProcess.exitValue();
- } catch (IllegalThreadStateException ie) {
- running = true;
- }
+ // Avoid calling IProcess.exitValue() inside a sync section (Bug 311813).
+ int exitValue = -1;
+ boolean running = false;
+ try {
+ exitValue = fProcess.exitValue();
+ } catch (IllegalThreadStateException ie) {
+ running = true;
+ }
synchronized (this) {
fTerminated= true;
if (!running) {
- fExitValue = exitValue;
+ fExitValue = exitValue;
}
fProcess= null;
}
@@ -265,9 +265,9 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
*/
@Override
public IStreamsProxy getStreamsProxy() {
- if (!fCaptureOutput) {
- return null;
- }
+ if (!fCaptureOutput) {
+ return null;
+ }
return fStreamsProxy;
}
@@ -277,9 +277,9 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
* @return streams proxy
*/
protected IStreamsProxy createStreamsProxy() {
- if (!fCaptureOutput) {
- return new NullStreamsProxy(getSystemProcess());
- }
+ if (!fCaptureOutput) {
+ return new NullStreamsProxy(getSystemProcess());
+ }
String encoding = getLaunch().getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING);
return new StreamsProxy(getSystemProcess(), encoding);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java
index 332f6af9e..3612cb1ff 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java
@@ -384,7 +384,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
@Override
public void initializeFromMemento(String memento) throws CoreException {
- doInitializeFromMemento(memento, true);
+ doInitializeFromMemento(memento, true);
}
/**
@@ -398,9 +398,9 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
* @since 3.1
*/
protected void doInitializeFromMemento(String memento, boolean dispose) throws CoreException {
- if (dispose) {
- dispose();
- }
+ if (dispose) {
+ dispose();
+ }
Element rootElement = DebugPlugin.parseDocument(memento);
if (!rootElement.getNodeName().equalsIgnoreCase(DIRECTOR_ROOT_NODE)) {
abort(SourceLookupMessages.AbstractSourceLookupDirector_14, null);
@@ -547,7 +547,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
@Override
public void initializeFromMemento(String memento, ILaunchConfiguration configuration) throws CoreException {
- dispose();
+ dispose();
setLaunchConfiguration(configuration);
doInitializeFromMemento(memento, false);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java
index b8c37e660..5659f020f 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java
@@ -37,7 +37,7 @@ public interface ISourceLookupParticipant {
/**
* Notification this participant has been added to the specified
* source lookup director.
- *
+ *
* @param director the source lookup director that this participant
* has been added to
*/
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java
index 7777b1ec5..e44e6e227 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java
@@ -59,7 +59,7 @@ public class ArchiveSourceContainer extends AbstractSourceContainer {
fFile = archive;
fDetectRoot = detectRootPath;
if (archive.exists() && archive.getLocation() != null) {
- fDelegateContainer = new ExternalArchiveSourceContainer(archive.getLocation().toOSString(), detectRootPath);
+ fDelegateContainer = new ExternalArchiveSourceContainer(archive.getLocation().toOSString(), detectRootPath);
}
}
@@ -93,38 +93,38 @@ public class ArchiveSourceContainer extends AbstractSourceContainer {
return getName().hashCode();
}
- @Override
+ @Override
public Object[] findSourceElements(String name) throws CoreException {
- ExternalArchiveSourceContainer container = getDelegateContainer();
- if (container != null) {
- return container.findSourceElements(name);
- }
- return EMPTY;
- }
+ ExternalArchiveSourceContainer container = getDelegateContainer();
+ if (container != null) {
+ return container.findSourceElements(name);
+ }
+ return EMPTY;
+ }
- /**
- * Returns the underlying external archive source container.
- *
- * @return underlying external archive source container
- * @since 3.0.1.1
- */
- private ExternalArchiveSourceContainer getDelegateContainer() {
- return fDelegateContainer;
- }
- @Override
+ /**
+ * Returns the underlying external archive source container.
+ *
+ * @return underlying external archive source container
+ * @since 3.0.1.1
+ */
+ private ExternalArchiveSourceContainer getDelegateContainer() {
+ return fDelegateContainer;
+ }
+ @Override
public void init(ISourceLookupDirector director) {
- super.init(director);
- if (fDelegateContainer != null) {
- fDelegateContainer.init(director);
- }
- }
- @Override
+ super.init(director);
+ if (fDelegateContainer != null) {
+ fDelegateContainer.init(director);
+ }
+ }
+ @Override
public void dispose() {
- super.dispose();
- if (fDelegateContainer != null) {
- fDelegateContainer.dispose();
- }
- }
+ super.dispose();
+ if (fDelegateContainer != null) {
+ fDelegateContainer.dispose();
+ }
+ }
/**
* Returns whether root paths are automatically detected in this
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java
index 6fb34cac5..0b21c4dc0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java
@@ -103,20 +103,20 @@ public abstract class ContainerSourceContainer extends CompositeSourceContainer
}
// bug 295828 root file may be null for an invalid linked resource
if (fRootFile != null) {
- // See bug 98090 - we need to handle relative path names
- IFileStore target = fRootFile.getFileStore(new Path(name));
- if (target.fetchInfo().exists()) {
- // We no longer have to account for bug 95832, and URIs take care
- // of canonical paths (fix to bug 95679 was removed).
- IFile[] files = fRoot.findFilesForLocationURI(target.toURI());
- if (isFindDuplicates() && files.length > 1) {
- for (int i = 0; i < files.length; i++) {
- sources.add(files[i]);
- }
- } else if (files.length > 0) {
- sources.add(files[0]);
- }
- }
+ // See bug 98090 - we need to handle relative path names
+ IFileStore target = fRootFile.getFileStore(new Path(name));
+ if (target.fetchInfo().exists()) {
+ // We no longer have to account for bug 95832, and URIs take care
+ // of canonical paths (fix to bug 95679 was removed).
+ IFile[] files = fRoot.findFilesForLocationURI(target.toURI());
+ if (isFindDuplicates() && files.length > 1) {
+ for (int i = 0; i < files.length; i++) {
+ sources.add(files[i]);
+ }
+ } else if (files.length > 0) {
+ sources.add(files[0]);
+ }
+ }
}
}
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
index cc991ebcb..9766252cb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java
@@ -336,14 +336,14 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
// delete any markers that are not to be restored
if (!delete.isEmpty()) {
- final IMarker[] delMarkers = delete.toArray(new IMarker[delete.size()]);
+ final IMarker[] delMarkers = delete.toArray(new IMarker[delete.size()]);
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor pm) throws CoreException {
- for (int i = 0; i < delMarkers.length; i++) {
- IMarker marker = delMarkers[i];
- marker.delete();
- }
+ for (int i = 0; i < delMarkers.length; i++) {
+ IMarker marker = delMarkers[i];
+ marker.delete();
+ }
}
};
new BreakpointManagerJob(wr).schedule();
@@ -359,20 +359,20 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
getWorkspace().removeResourceChangeListener(this);
getWorkspace().removeResourceChangeListener(fPostChangeListener);
fBreakpointListeners.clear();
- fBreakpointsListeners.clear();
- fBreakpointManagerListeners.clear();
- if(fImportParticipants != null) {
- fImportParticipants.clear();
- fImportParticipants = null;
- fDefaultParticipant = null;
- }
- if(fBreakpoints != null) {
- fBreakpoints.clear();
- fBreakpoints = null;
- }
- if(fMarkersToBreakpoints != null) {
- fMarkersToBreakpoints.clear();
- }
+ fBreakpointsListeners.clear();
+ fBreakpointManagerListeners.clear();
+ if(fImportParticipants != null) {
+ fImportParticipants.clear();
+ fImportParticipants = null;
+ fDefaultParticipant = null;
+ }
+ if(fBreakpoints != null) {
+ fBreakpoints.clear();
+ fBreakpoints = null;
+ }
+ if(fMarkersToBreakpoints != null) {
+ fMarkersToBreakpoints.clear();
+ }
}
/**
@@ -597,7 +597,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
*/
@Override
public void addBreakpoints(IBreakpoint[] breakpoints) throws CoreException {
- addBreakpoints(breakpoints, true);
+ addBreakpoints(breakpoints, true);
}
/**
@@ -615,7 +615,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
if (!getBreakpoints0().contains(breakpoint)) {
verifyBreakpoint(breakpoint);
if (breakpoint.isRegistered()) {
- // If notify == false, the breakpoints are just being added at startup
+ // If notify == false, the breakpoints are just being added at startup
added.add(breakpoint);
getBreakpoints0().add(breakpoint);
fMarkersToBreakpoints.put(breakpoint.getMarker(), breakpoint);
@@ -626,7 +626,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
}
if (notify) {
- fireUpdate(added, null, ADDED);
+ fireUpdate(added, null, ADDED);
}
if (!update.isEmpty()) {
IWorkspaceRunnable r = new IWorkspaceRunnable() {
@@ -646,7 +646,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
getWorkspace().run(r, null, 0, null);
fSuppressChange.removeAll(update);
if (notify) {
- fireUpdate(update, null, ADDED);
+ fireUpdate(update, null, ADDED);
}
}
}
@@ -760,10 +760,10 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
IWorkspaceRunnable wRunnable= new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor monitor) throws CoreException {
- IMarker[] markers = fMoved.toArray(new IMarker[fMoved.size()]);
+ IMarker[] markers = fMoved.toArray(new IMarker[fMoved.size()]);
for (int i = 0; i < markers.length; i++) {
- markers[i].delete();
- }
+ markers[i].delete();
+ }
}
};
try {
@@ -1076,7 +1076,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
for (int j = 0; j < breakpoints.length; j++) {
fBreakpoint = breakpoints[j];
fDelta = deltas[j];
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
}
fListener = null;
@@ -1151,11 +1151,11 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
@Override
public void setEnabled(final boolean enabled) {
- if (isEnabled() != enabled) {
- Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, enabled, null);
+ if (isEnabled() != enabled) {
+ Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, enabled, null);
touchAllBreakpoints();
- new BreakpointManagerNotifier().notify(enabled);
- }
+ new BreakpointManagerNotifier().notify(enabled);
+ }
}
@Override
@@ -1197,7 +1197,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
fManagerEnabled= enabled;
for (IBreakpointManagerListener iBreakpointManagerListener : fBreakpointManagerListeners) {
fListener = iBreakpointManagerListener;
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
fListener = null;
}
@@ -1259,21 +1259,21 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
}
- @Override
+ @Override
public String getTypeName(IBreakpoint breakpoint) {
- String typeName= null;
- IMarker marker = breakpoint.getMarker();
- if (marker != null) {
- try {
- IConfigurationElement element = fBreakpointExtensions.get(marker.getType());
- if (element != null) {
- typeName= element.getAttribute(IConfigurationElementConstants.NAME);
- }
- }
- catch (CoreException e) {}
- }
- return typeName;
- }
+ String typeName= null;
+ IMarker marker = breakpoint.getMarker();
+ if (marker != null) {
+ try {
+ IConfigurationElement element = fBreakpointExtensions.get(marker.getType());
+ if (element != null) {
+ typeName= element.getAttribute(IConfigurationElementConstants.NAME);
+ }
+ }
+ catch (CoreException e) {}
+ }
+ return typeName;
+ }
@Override
public IBreakpointImportParticipant[] getImportParticipants(String markertype) throws CoreException {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java
index 0a9cba4e0..92f0d7ad0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java
@@ -40,12 +40,12 @@ public class EnvironmentVariableResolver implements IDynamicVariableResolver {
String value = map.get(argument);
if (value == null && Platform.getOS().equals(Constants.OS_WIN32)) {
// On Win32, env variables are case insensitive, so we search the map
- // for matches manually.
+ // for matches manually.
for (Entry<String, String> entry : map.entrySet()) {
String key = entry.getKey();
- if (key.equalsIgnoreCase(argument)) {
- return entry.getValue();
- }
+ if (key.equalsIgnoreCase(argument)) {
+ return entry.getValue();
+ }
}
}
return value;
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
index c2ad9aca0..d3a27a28d 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java
@@ -134,11 +134,11 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
}
}
- @Override
+ @Override
public boolean hasWatchExpressionDelegate(String id) {
- IConfigurationElement element= fWatchExpressionDelegates.get(id);
- return element != null;
- }
+ IConfigurationElement element= fWatchExpressionDelegates.get(id);
+ return element != null;
+ }
/**
* Loads any persisted watch expressions from the preferences.
@@ -568,7 +568,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
fListener = iExpressionListener;
for (int j = 0; j < expressions.length; j++) {
fExpression = expressions[j];
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
}
}
@@ -647,7 +647,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
fIndex = index;
for (IExpressionsListener iExpressionsListener : fExpressionsListeners) {
fListener = iExpressionsListener;
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
}
fNotifierExpressions = null;
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java
index 41f34957e..b77c5c957 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java
@@ -328,23 +328,23 @@ public interface IConfigurationElementConstants {
*/
String MEMENTO = "memento"; //$NON-NLS-1$
- /**
- * The selection node name for a configuration element.
- * <p>Equal to the word: <code>selection</code></p>
- */
- String SELECTION = "selection"; //$NON-NLS-1$
-
- /**
- * The debugContext node name for a configuration element.
- * <p>Equal to the word: <code>debugContext</code></p>
- */
- String DEBUG_CONTEXT = "debugContext"; //$NON-NLS-1$
-
- /**
- * The editorInput node name for a configuration element.
- * <p>Equal to the word: <code>editorInput</code></p>
- */
- String EDITOR_INPUT = "editorInput"; //$NON-NLS-1$
+ /**
+ * The selection node name for a configuration element.
+ * <p>Equal to the word: <code>selection</code></p>
+ */
+ String SELECTION = "selection"; //$NON-NLS-1$
+
+ /**
+ * The debugContext node name for a configuration element.
+ * <p>Equal to the word: <code>debugContext</code></p>
+ */
+ String DEBUG_CONTEXT = "debugContext"; //$NON-NLS-1$
+
+ /**
+ * The editorInput node name for a configuration element.
+ * <p>Equal to the word: <code>editorInput</code></p>
+ */
+ String EDITOR_INPUT = "editorInput"; //$NON-NLS-1$
/**
* The allowPrototypes node name for a configuration element
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
index fe531aae3..d06a8346f 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
@@ -124,7 +124,7 @@ public class InputStreamMonitor {
}
if (!fClosed) {
try {
- fStream.close();
+ fStream.close();
} catch (IOException e) {
DebugPlugin.log(e);
}
@@ -157,20 +157,20 @@ public class InputStreamMonitor {
}
}
- /**
- * Closes the output stream attached to the standard input stream of this
- * monitor's process.
- *
- * @exception IOException if an exception occurs closing the input stream
- */
- public void closeInputStream() throws IOException {
- if (!fClosed) {
- fClosed = true;
- fStream.close();
- } else {
- throw new IOException();
- }
-
- }
+ /**
+ * Closes the output stream attached to the standard input stream of this
+ * monitor's process.
+ *
+ * @exception IOException if an exception occurs closing the input stream
+ */
+ public void closeInputStream() throws IOException {
+ if (!fClosed) {
+ fClosed = true;
+ fStream.close();
+ } else {
+ throw new IOException();
+ }
+
+ }
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
index f017d5700..0a10cb9cb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
@@ -291,8 +291,8 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
if (object instanceof LaunchConfiguration) {
LaunchConfiguration otherConfig = (LaunchConfiguration) object;
return getName().equals(otherConfig.getName())
- && getType().equals(otherConfig.getType())
- && equalOrNull(getContainer(), otherConfig.getContainer())
+ && getType().equals(otherConfig.getType())
+ && equalOrNull(getContainer(), otherConfig.getContainer())
&& getInfo().equals(otherConfig.getInfo());
}
return false;
@@ -717,21 +717,21 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
@Override
public ILaunch launch(String mode, IProgressMonitor monitor, boolean build) throws CoreException {
- return launch(mode, monitor, build, true);
+ return launch(mode, monitor, build, true);
}
- @Override
+ @Override
public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException {
- /* Setup progress monitor
- * - Prepare delegate (0)
- * - Pre-launch check (1)
- * - [Build before launch (7)] if build
- * - [Incremental build before launch (3)] if build
- * - Final launch validation (1)
- * - Initialize source locator (1)
- * - Launch delegate (10) */
+ /* Setup progress monitor
+ * - Prepare delegate (0)
+ * - Pre-launch check (1)
+ * - [Build before launch (7)] if build
+ * - [Incremental build before launch (3)] if build
+ * - Final launch validation (1)
+ * - Initialize source locator (1)
+ * - Launch delegate (10) */
SubMonitor lmonitor = SubMonitor.convert(monitor, DebugCoreMessages.LaunchConfiguration_9, build ? 23 : 13);
- try {
+ try {
// bug 28245 - force the delegate to load in case it is interested in launch notifications
Set<String> modes = getModes();
modes.add(mode);
@@ -809,9 +809,9 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
launch.setAttribute(DebugPlugin.ATTR_LAUNCH_TIMESTAMP, Long.toString(System.currentTimeMillis()));
boolean captureOutput = getAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, true);
if(!captureOutput) {
- launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, "false"); //$NON-NLS-1$
+ launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, "false"); //$NON-NLS-1$
} else {
- launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, null);
+ launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, null);
}
launch.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, getLaunchManager().getEncoding(this));
if (register) {
@@ -884,13 +884,13 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
getLaunchManager().removeLaunch(launch);
}
return launch;
- }
- finally {
+ }
+ finally {
lmonitor.done();
- }
- }
+ }
+ }
- @Override
+ @Override
public void migrate() throws CoreException {
((LaunchConfigurationType)getType()).migrate(this);
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index ebe43feec..d505c00e9 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -124,24 +124,24 @@ import com.ibm.icu.text.MessageFormat;
*/
public class LaunchManager extends PlatformObject implements ILaunchManager, IResourceChangeListener {
- /**
- * Preferred launch delegate preference name.
- * <p>
- * Prior to 3.5 this preferred launch delegates for all launch
- * configuration types were serialized into a single XML string
- * and stored in this preference.
- * </p>
- * <p>
- * Since 3.5, the preferred launch delegates are stored in a separate
- * preference for each launch configuration type. The name of this
- * preference is composed of the prefix, followed by a slash, followed by
- * the launch configuration type id. The values contain a set of launch
- * delegates, delimited by a semicolon, and each delegate entry contains
- * the delegate ID, followed by a comma, followed by comma-delimited
- * launch modes.
- *
- * @since 3.3
- */
+ /**
+ * Preferred launch delegate preference name.
+ * <p>
+ * Prior to 3.5 this preferred launch delegates for all launch
+ * configuration types were serialized into a single XML string
+ * and stored in this preference.
+ * </p>
+ * <p>
+ * Since 3.5, the preferred launch delegates are stored in a separate
+ * preference for each launch configuration type. The name of this
+ * preference is composed of the prefix, followed by a slash, followed by
+ * the launch configuration type id. The values contain a set of launch
+ * delegates, delimited by a semicolon, and each delegate entry contains
+ * the delegate ID, followed by a comma, followed by comma-delimited
+ * launch modes.
+ *
+ * @since 3.3
+ */
protected static final String PREF_PREFERRED_DELEGATES = DebugPlugin.getUniqueIdentifier() + ".PREFERRED_DELEGATES"; //$NON-NLS-1$
/**
@@ -259,7 +259,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
fRegistered = null;
for (ILaunchesListener iLaunchesListener : fLaunchesListeners) {
fListener = iLaunchesListener;
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
fNotifierLaunches = null;
fRegistered = null;
@@ -357,7 +357,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (project.isOpen()) {
LaunchManager.this.projectOpened(project);
} else {
- LaunchManager.this.projectClosed(project);
+ LaunchManager.this.projectClosed(project);
}
}
return false;
@@ -414,7 +414,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
fType = update;
for (ILaunchListener iLaunchListener : fListeners) {
fListener = iLaunchListener;
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
fLaunch = null;
fListener = null;
@@ -656,7 +656,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
private ILaunchConfiguration fTo;
- /**
+ /**
* Map of source container type extensions. Keys are extension ids
* and values are associated configuration elements.
*/
@@ -776,7 +776,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
// pattern is [func name]=() { and we must find the '}' on its own line with no trailing ';'
try (InputStream stream = process.getInputStream();
InputStreamReader isreader = new InputStreamReader(stream);
- BufferedReader reader = new BufferedReader(isreader)) {
+ BufferedReader reader = new BufferedReader(isreader)) {
String line = reader.readLine();
String key = null;
String value = null;
@@ -1097,7 +1097,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if(reservednames == null) {
return generateUniqueLaunchConfigurationNameFrom(basename);
}
- int index = 1;
+ int index = 1;
int length= basename.length();
String base = basename;
int copyIndex = base.lastIndexOf(" ("); //$NON-NLS-1$
@@ -1256,10 +1256,10 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @return the resource delta visitor for the launch manager
*/
private LaunchManagerVisitor getDeltaVisitor() {
- if (fgVisitor == null) {
+ if (fgVisitor == null) {
fgVisitor= new LaunchManagerVisitor();
}
- return fgVisitor;
+ return fgVisitor;
}
/**
@@ -1296,35 +1296,35 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
String nativeKey = null;
for (Entry<String, String> entry : configEnv.entrySet()) {
key = entry.getKey();
- value = entry.getValue();
- // translate any string substitution variables
- if (value != null) {
- value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
- }
- boolean added= false;
+ value = entry.getValue();
+ // translate any string substitution variables
+ if (value != null) {
+ value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
+ }
+ boolean added= false;
if (win32) {
- // First, check if the key is an exact match for an existing key.
+ // First, check if the key is an exact match for an existing key.
nativeValue = env.get(key);
- if (nativeValue != null) {
- // If an exact match is found, just replace the value
- env.put(key, value);
- } else {
- // Win32 variables are case-insensitive. If an exact match isn't found, iterate to
- // check for a case-insensitive match. We maintain the key's case (see bug 86725),
- // but do a case-insensitive comparison (for example, "pAtH" will still override "PATH").
+ if (nativeValue != null) {
+ // If an exact match is found, just replace the value
+ env.put(key, value);
+ } else {
+ // Win32 variables are case-insensitive. If an exact match isn't found, iterate to
+ // check for a case-insensitive match. We maintain the key's case (see bug 86725),
+ // but do a case-insensitive comparison (for example, "pAtH" will still override "PATH").
for (Entry<String, String> nativeEntry : env.entrySet()) {
nativeKey = (nativeEntry).getKey();
- if (nativeKey.equalsIgnoreCase(key)) {
- nativeEntry.setValue(value);
- added = true;
- break;
- }
- }
- }
- }
- if (!added) {
- env.put(key, value);
- }
+ if (nativeKey.equalsIgnoreCase(key)) {
+ nativeEntry.setValue(value);
+ added = true;
+ break;
+ }
+ }
+ }
+ }
+ if (!added) {
+ env.put(key, value);
+ }
}
List<String> strings = new ArrayList<>(env.size());
StringBuilder buffer = null;
@@ -1643,14 +1643,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
element = (Element) nodes.item(i);
String delegateid = element.getAttribute(IConfigurationElementConstants.ID);
typeid = element.getAttribute(IConfigurationElementConstants.TYPE_ID);
- String[] modes = element.getAttribute(IConfigurationElementConstants.MODES).split(","); //$NON-NLS-1$
+ String[] modes = element.getAttribute(IConfigurationElementConstants.MODES).split(","); //$NON-NLS-1$
modeset = new HashSet<>(Arrays.asList(modes));
LaunchDelegate delegate = getLaunchDelegateExtension(typeid, delegateid, modeset);
if (delegate != null) {
- //take type id, modeset, delegate and create entry
- if(!IInternalDebugCoreConstants.EMPTY_STRING.equals(typeid) & modeset != null) {
- fPreferredDelegates.add(new PreferredDelegate(delegate, typeid, modeset));
- }
+ //take type id, modeset, delegate and create entry
+ if(!IInternalDebugCoreConstants.EMPTY_STRING.equals(typeid) & modeset != null) {
+ fPreferredDelegates.add(new PreferredDelegate(delegate, typeid, modeset));
+ }
}
}
}
@@ -1666,7 +1666,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @since 3.6
*/
protected void resetPreferredDelegates() {
- fPreferredDelegates = null;
+ fPreferredDelegates = null;
}
/**
@@ -1678,8 +1678,8 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @since 3.3
*/
protected ILaunchDelegate getPreferredDelegate(String typeid, Set<String> modes) {
- // Retrieve preferred delegates using legacy mechanism for backward
- // compatibility.
+ // Retrieve preferred delegates using legacy mechanism for backward
+ // compatibility.
initializePreferredDelegates();
for (PreferredDelegate pd : fPreferredDelegates) {
if(pd.getModes().equals(modes) & pd.getTypeId().equals(typeid)) {
@@ -1690,23 +1690,23 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
// @since 3.5
// If the legacy mechanism didn't work, try the new preference name for
// the given launch type.
- String preferred = Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), "//" + LaunchManager.PREF_PREFERRED_DELEGATES + '/' + typeid, IInternalDebugCoreConstants.EMPTY_STRING, null); //$NON-NLS-1$
- if (preferred != null && preferred.length() != 0) {
- StringTokenizer tokenizer = new StringTokenizer(preferred, ";"); //$NON-NLS-1$
- while(tokenizer.hasMoreTokens()) {
- StringTokenizer tokenizer2 = new StringTokenizer(tokenizer.nextToken(), ","); //$NON-NLS-1$
- String delegateId = tokenizer2.nextToken();
+ String preferred = Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), "//" + LaunchManager.PREF_PREFERRED_DELEGATES + '/' + typeid, IInternalDebugCoreConstants.EMPTY_STRING, null); //$NON-NLS-1$
+ if (preferred != null && preferred.length() != 0) {
+ StringTokenizer tokenizer = new StringTokenizer(preferred, ";"); //$NON-NLS-1$
+ while(tokenizer.hasMoreTokens()) {
+ StringTokenizer tokenizer2 = new StringTokenizer(tokenizer.nextToken(), ","); //$NON-NLS-1$
+ String delegateId = tokenizer2.nextToken();
HashSet<String> modeset = new HashSet<>();
- while(tokenizer2.hasMoreTokens()) {
- modeset.add(tokenizer2.nextToken());
- }
- LaunchDelegate delegate = getLaunchDelegateExtension(typeid, delegateId, modeset);
- if (delegate != null && modeset.equals(modes)) {
- return delegate;
- }
- }
-
- }
+ while(tokenizer2.hasMoreTokens()) {
+ modeset.add(tokenizer2.nextToken());
+ }
+ LaunchDelegate delegate = getLaunchDelegateExtension(typeid, delegateId, modeset);
+ if (delegate != null && modeset.equals(modes)) {
+ return delegate;
+ }
+ }
+
+ }
return null;
}
@@ -1723,16 +1723,16 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @since 3.5
*/
private LaunchDelegate getLaunchDelegateExtension(String typeId, String id, Set<String> modeset) {
- LaunchDelegate[] extensions = getLaunchDelegates(typeId);
- for(int j = 0; j < extensions.length; j++) {
- if(id.equals(extensions[j].getId())) {
+ LaunchDelegate[] extensions = getLaunchDelegates(typeId);
+ for(int j = 0; j < extensions.length; j++) {
+ if(id.equals(extensions[j].getId())) {
List<Set<String>> modesets = extensions[j].getModes();
- if(modesets.contains(modeset)) {
- return extensions[j];
- }
- }
- }
- return null;
+ if(modesets.contains(modeset)) {
+ return extensions[j];
+ }
+ }
+ }
+ return null;
}
/**
@@ -1880,14 +1880,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
/**
- * Starts listening for resource change events
- */
- private synchronized void hookResourceChangeListener() {
- if (!fListening) {
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_DELETE);
- fListening = true;
- }
- }
+ * Starts listening for resource change events
+ */
+ private synchronized void hookResourceChangeListener() {
+ if (!fListening) {
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_DELETE);
+ fListening = true;
+ }
+ }
/**
* Load comparator extensions.
@@ -2267,19 +2267,19 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
if (delta != null) {
- LaunchManagerVisitor visitor = getDeltaVisitor();
- MappedResourceVisitor v = null;
- if (isDeleteConfigurations()) {
- v = getMappedResourceVisitor();
- }
- try {
- delta.accept(visitor);
- if (v != null) {
- delta.accept(v);
- }
- } catch (CoreException e) {
- DebugPlugin.log(e.getStatus());
- }
+ LaunchManagerVisitor visitor = getDeltaVisitor();
+ MappedResourceVisitor v = null;
+ if (isDeleteConfigurations()) {
+ v = getMappedResourceVisitor();
+ }
+ try {
+ delta.accept(visitor);
+ if (v != null) {
+ delta.accept(v);
+ }
+ } catch (CoreException e) {
+ DebugPlugin.log(e.getStatus());
+ }
}
}
@@ -2311,8 +2311,8 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
} catch (CoreException e) {
- DebugPlugin.log(e);
- }
+ DebugPlugin.log(e);
+ }
return list;
}
@@ -2343,15 +2343,15 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
launch = launches[i];
if(launch != null) {
try {
- if (launch instanceof IDisconnect) {
- IDisconnect disconnect = (IDisconnect)launch;
- if (disconnect.canDisconnect()) {
- disconnect.disconnect();
- }
- }
- if (launch.canTerminate()) {
- launch.terminate();
- }
+ if (launch instanceof IDisconnect) {
+ IDisconnect disconnect = (IDisconnect)launch;
+ if (disconnect.canDisconnect()) {
+ disconnect.disconnect();
+ }
+ }
+ if (launch.canTerminate()) {
+ launch.terminate();
+ }
} catch (DebugException e) {
DebugPlugin.log(e);
}
@@ -2370,10 +2370,10 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @since 3.3
*/
public void persistPreferredLaunchDelegates() {
- ILaunchConfigurationType[] types = getLaunchConfigurationTypes();
- for(int i = 0; i < types.length; i++) {
- persistPreferredLaunchDelegate((LaunchConfigurationType)types[i]);
- }
+ ILaunchConfigurationType[] types = getLaunchConfigurationTypes();
+ for(int i = 0; i < types.length; i++) {
+ persistPreferredLaunchDelegate((LaunchConfigurationType)types[i]);
+ }
}
/**
@@ -2382,31 +2382,31 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
*
* @since 3.6
*/
- public void persistPreferredLaunchDelegate(LaunchConfigurationType type) {
- String preferenceName = PREF_PREFERRED_DELEGATES + '/' + type.getIdentifier();
+ public void persistPreferredLaunchDelegate(LaunchConfigurationType type) {
+ String preferenceName = PREF_PREFERRED_DELEGATES + '/' + type.getIdentifier();
Map<Set<String>, ILaunchDelegate> preferred = type.getPreferredDelegates();
- if(preferred != null && preferred.size() > 0) {
- StringBuilder str = new StringBuilder();
+ if(preferred != null && preferred.size() > 0) {
+ StringBuilder str = new StringBuilder();
for (Entry<Set<String>, ILaunchDelegate> entry : preferred.entrySet()) {
Set<String> modes = entry.getKey();
ILaunchDelegate delegate = entry.getValue();
if (delegate != null) {
- str.append(delegate.getId());
- str.append(',');
+ str.append(delegate.getId());
+ str.append(',');
for (String mode : modes) {
str.append(mode).append(',');
- }
+ }
str.append(';');
- }
- }
- Preferences.setString(DebugPlugin.getUniqueIdentifier(), preferenceName, str.toString(), null);
- } else {
- Preferences.setToDefault(DebugPlugin.getUniqueIdentifier(), preferenceName);
- }
+ }
+ }
+ Preferences.setString(DebugPlugin.getUniqueIdentifier(), preferenceName, str.toString(), null);
+ } else {
+ Preferences.setToDefault(DebugPlugin.getUniqueIdentifier(), preferenceName);
+ }
- // Reset the legacy preference string.
- Preferences.setToDefault(DebugPlugin.getUniqueIdentifier(), PREF_PREFERRED_DELEGATES);
- }
+ // Reset the legacy preference string.
+ Preferences.setToDefault(DebugPlugin.getUniqueIdentifier(), PREF_PREFERRED_DELEGATES);
+ }
/**
* finds and terminates any running launch configurations associated with the given resource
@@ -2485,28 +2485,28 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @param label label to process
* @return label without accelerators
*/
- public static String removeAccelerators(String label) {
- String title = label;
- if (title != null) {
- // strip out any '&' (accelerators)
- int index = title.indexOf('&');
- if (index == 0) {
- title = title.substring(1);
- } else if (index > 0) {
- //DBCS languages use "(&X)" format
- if (title.charAt(index - 1) == '(' && title.length() >= index + 3 && title.charAt(index + 2) == ')') {
- String first = title.substring(0, index - 1);
- String last = title.substring(index + 3);
- title = first + last;
- } else if (index < (title.length() - 1)) {
- String first = title.substring(0, index);
- String last = title.substring(index + 1);
- title = first + last;
- }
- }
- }
- return title;
- }
+ public static String removeAccelerators(String label) {
+ String title = label;
+ if (title != null) {
+ // strip out any '&' (accelerators)
+ int index = title.indexOf('&');
+ if (index == 0) {
+ title = title.substring(1);
+ } else if (index > 0) {
+ //DBCS languages use "(&X)" format
+ if (title.charAt(index - 1) == '(' && title.length() >= index + 3 && title.charAt(index + 2) == ')') {
+ String first = title.substring(0, index - 1);
+ String last = title.substring(index + 3);
+ title = first + last;
+ } else if (index < (title.length() - 1)) {
+ String first = title.substring(0, index);
+ String last = title.substring(index + 1);
+ title = first + last;
+ }
+ }
+ }
+ return title;
+ }
/**
* Returns the singleton step filter manager.
@@ -2615,7 +2615,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
while ((i = fis.read(buf)) != -1) {
fos.write(buf, 0, i);
}
- }
+ }
}
/**
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
index 5362c0dd4..396160866 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java
@@ -39,37 +39,37 @@ public class LogicalStructureManager {
private List<LogicalStructureType> fTypes = null;
private List<LogicalStructureProvider> fTypeProviders;
- /**
- * Map containing the user's selection for each combination of logical
- * structure types.
- * key: String - Comma-separated list of ints representing a combination of structure types.
- * These integers are indeces into the fStructureTypeIds array.
- * value: Integer - One of the ints from the combo key (the one chosen by the user) or -1 if
- * the user has chosen not to display any structures for this combination
- */
+ /**
+ * Map containing the user's selection for each combination of logical
+ * structure types.
+ * key: String - Comma-separated list of ints representing a combination of structure types.
+ * These integers are indeces into the fStructureTypeIds array.
+ * value: Integer - One of the ints from the combo key (the one chosen by the user) or -1 if
+ * the user has chosen not to display any structures for this combination
+ */
private Map<String, Integer> fStructureTypeSelections = null;
- /**
- * List of known type identifiers. An identifier's index in this list is used as
- * its ID number. This list is maintained as a space-saving measure so that the various
- * combinations of structure types can be persisted using indeces instead of storing the
- * full index strings.
- */
+ /**
+ * List of known type identifiers. An identifier's index in this list is used as
+ * its ID number. This list is maintained as a space-saving measure so that the various
+ * combinations of structure types can be persisted using indeces instead of storing the
+ * full index strings.
+ */
private List<String> fStructureTypeIds = null;
- /**
- * Preference key used for storing the user's selected structure for each combination
- * or structures. The preference value is stored in the form:
- * int,int,...,int|int,int,...int|...
- * Where int is an integer index of a structure in the array of known structures.
- */
- public static final String PREF_STRUCTURE_SELECTIONS= "selectedStructures"; //$NON-NLS-1$
- /**
- * Preference key used for storing the array of known structures. The preference
- * value is in the form:
- * string,string,string,...,string,
- * Where string is an identifier of a logical structure.
- */
- public static final String PREF_STRUCTURE_IDS= "allStructures"; //$NON-NLS-1$
+ /**
+ * Preference key used for storing the user's selected structure for each combination
+ * or structures. The preference value is stored in the form:
+ * int,int,...,int|int,int,...int|...
+ * Where int is an integer index of a structure in the array of known structures.
+ */
+ public static final String PREF_STRUCTURE_SELECTIONS= "selectedStructures"; //$NON-NLS-1$
+ /**
+ * Preference key used for storing the array of known structures. The preference
+ * value is in the form:
+ * string,string,string,...,string,
+ * Where string is an identifier of a logical structure.
+ */
+ public static final String PREF_STRUCTURE_IDS= "allStructures"; //$NON-NLS-1$
public static LogicalStructureManager getDefault() {
if (fgDefault == null) {
@@ -78,11 +78,11 @@ public class LogicalStructureManager {
return fgDefault;
}
- /**
- * Returns the logical structure types that are applicable to the given value.
- * @param value the value
- * @return the logical structure types that are applicable to the given value
- */
+ /**
+ * Returns the logical structure types that are applicable to the given value.
+ * @param value the value
+ * @return the logical structure types that are applicable to the given value
+ */
public ILogicalStructureType[] getLogicalStructureTypes(IValue value) {
initialize();
// looks in the logical structure types
@@ -102,144 +102,144 @@ public class LogicalStructureManager {
return select.toArray(new ILogicalStructureType[select.size()]);
}
- /**
- * Loads the map of structure selections from the preference store.
- */
- private void loadStructureTypeSelections() {
+ /**
+ * Loads the map of structure selections from the preference store.
+ */
+ private void loadStructureTypeSelections() {
fStructureTypeSelections = new HashMap<>();
- String selections= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_SELECTIONS, IInternalDebugCoreConstants.EMPTY_STRING, null);
- // selections are stored in the form:
- // selection|selection|...selection|
- StringTokenizer tokenizer= new StringTokenizer(selections, "|"); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String selection = tokenizer.nextToken();
- // selection string is of the form:
- // id,id,...,selectedid
- int i = selection.lastIndexOf(',');
- if (i > 0 && i < selection.length() - 1) {
- String comboKey= selection.substring(0, i + 1);
- String selected= selection.substring(i + 1, selection.length());
- fStructureTypeSelections.put(comboKey, Integer.valueOf(Integer.parseInt(selected)));
- }
- }
- }
+ String selections= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_SELECTIONS, IInternalDebugCoreConstants.EMPTY_STRING, null);
+ // selections are stored in the form:
+ // selection|selection|...selection|
+ StringTokenizer tokenizer= new StringTokenizer(selections, "|"); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens()) {
+ String selection = tokenizer.nextToken();
+ // selection string is of the form:
+ // id,id,...,selectedid
+ int i = selection.lastIndexOf(',');
+ if (i > 0 && i < selection.length() - 1) {
+ String comboKey= selection.substring(0, i + 1);
+ String selected= selection.substring(i + 1, selection.length());
+ fStructureTypeSelections.put(comboKey, Integer.valueOf(Integer.parseInt(selected)));
+ }
+ }
+ }
- /**
- * Stores the map of structure selections to the preference store
- */
- private void storeStructureTypeSelections() {
- StringBuilder buffer= new StringBuilder();
+ /**
+ * Stores the map of structure selections to the preference store
+ */
+ private void storeStructureTypeSelections() {
+ StringBuilder buffer= new StringBuilder();
for (Entry<String, Integer> entry : fStructureTypeSelections.entrySet()) {
buffer.append(entry.getKey());
- buffer.append(entry.getValue());
- buffer.append('|');
- }
- Preferences.setString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_SELECTIONS, buffer.toString(), null);
- }
+ buffer.append(entry.getValue());
+ buffer.append('|');
+ }
+ Preferences.setString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_SELECTIONS, buffer.toString(), null);
+ }
- /**
- * Loads the collection of known structures identifiers from the preference store
- */
- private void loadStructureTypeIds() {
+ /**
+ * Loads the collection of known structures identifiers from the preference store
+ */
+ private void loadStructureTypeIds() {
fStructureTypeIds = new ArrayList<>();
- // Types are stored as a comma-separated, ordered list.
- String types= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_IDS, IInternalDebugCoreConstants.EMPTY_STRING, null);
- StringTokenizer tokenizer= new StringTokenizer(types, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String id= tokenizer.nextToken();
- if (id.length() > 0) {
- fStructureTypeIds.add(id);
- }
- }
- }
+ // Types are stored as a comma-separated, ordered list.
+ String types= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_IDS, IInternalDebugCoreConstants.EMPTY_STRING, null);
+ StringTokenizer tokenizer= new StringTokenizer(types, ","); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens()) {
+ String id= tokenizer.nextToken();
+ if (id.length() > 0) {
+ fStructureTypeIds.add(id);
+ }
+ }
+ }
- /**
- * Stores the collection of known structure identifiers to the preference store
- */
- private void storeStructureTypeIds() {
- StringBuilder buffer= new StringBuilder();
+ /**
+ * Stores the collection of known structure identifiers to the preference store
+ */
+ private void storeStructureTypeIds() {
+ StringBuilder buffer= new StringBuilder();
for (String id : fStructureTypeIds) {
buffer.append(id).append(',');
- }
- Preferences.setString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_IDS, buffer.toString(), null);
- }
+ }
+ Preferences.setString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_IDS, buffer.toString(), null);
+ }
- /**
- * Returns the structure that the user has chosen from among the given
- * collection of structures or <code>null</code> if the user has chosen
- * to display none.
- * @param structureTypes the collection of structures available
- * @return the structure that the user has chosen from among the given collection
- * or <code>null</code> if the user has chosen to display none
- */
- public ILogicalStructureType getSelectedStructureType(ILogicalStructureType[] structureTypes) {
- if (structureTypes.length == 0) {
- return null;
- }
- String combo= getComboString(structureTypes);
- // Lookup the combo
- Integer index = fStructureTypeSelections.get(combo);
- if (index == null) {
- // If the user hasn't explicitly chosen anything for this
- // combo yet, just return the first type.
- return structureTypes[0];
- } else if (index.intValue() == -1) {
- // An index of -1 means the user has deselected all structures for this combo
- return null;
- }
- // If an index is stored for this combo, retrieve the id at the index
- String id= fStructureTypeIds.get(index.intValue());
- for (int i = 0; i < structureTypes.length; i++) {
- // Return the type with the retrieved id
- ILogicalStructureType type = structureTypes[i];
- if (type.getId().equals(id)) {
- return type;
- }
- }
- return structureTypes[0];
- }
+ /**
+ * Returns the structure that the user has chosen from among the given
+ * collection of structures or <code>null</code> if the user has chosen
+ * to display none.
+ * @param structureTypes the collection of structures available
+ * @return the structure that the user has chosen from among the given collection
+ * or <code>null</code> if the user has chosen to display none
+ */
+ public ILogicalStructureType getSelectedStructureType(ILogicalStructureType[] structureTypes) {
+ if (structureTypes.length == 0) {
+ return null;
+ }
+ String combo= getComboString(structureTypes);
+ // Lookup the combo
+ Integer index = fStructureTypeSelections.get(combo);
+ if (index == null) {
+ // If the user hasn't explicitly chosen anything for this
+ // combo yet, just return the first type.
+ return structureTypes[0];
+ } else if (index.intValue() == -1) {
+ // An index of -1 means the user has deselected all structures for this combo
+ return null;
+ }
+ // If an index is stored for this combo, retrieve the id at the index
+ String id= fStructureTypeIds.get(index.intValue());
+ for (int i = 0; i < structureTypes.length; i++) {
+ // Return the type with the retrieved id
+ ILogicalStructureType type = structureTypes[i];
+ if (type.getId().equals(id)) {
+ return type;
+ }
+ }
+ return structureTypes[0];
+ }
- /**
- *
- * @param types the array of types
- * @param selected the type that is selected for the given combo or <code>null</code>
- * if the user has de-selected any structure for the given combo
- */
- public void setEnabledType(ILogicalStructureType[] types, ILogicalStructureType selected) {
- String combo= getComboString(types);
- int index= -1; // Initialize to "none selected"
- if (selected != null) {
- index= fStructureTypeIds.indexOf(selected.getId());
- }
- Integer integer= Integer.valueOf(index);
- fStructureTypeSelections.put(combo, integer);
- storeStructureTypeSelections();
- storeStructureTypeIds();
- }
+ /**
+ *
+ * @param types the array of types
+ * @param selected the type that is selected for the given combo or <code>null</code>
+ * if the user has de-selected any structure for the given combo
+ */
+ public void setEnabledType(ILogicalStructureType[] types, ILogicalStructureType selected) {
+ String combo= getComboString(types);
+ int index= -1; // Initialize to "none selected"
+ if (selected != null) {
+ index= fStructureTypeIds.indexOf(selected.getId());
+ }
+ Integer integer= Integer.valueOf(index);
+ fStructureTypeSelections.put(combo, integer);
+ storeStructureTypeSelections();
+ storeStructureTypeIds();
+ }
- /**
- * Returns the string representing the given combination of logical
- * structure types. This string will be a series of comma-separated
- * indices representing the various types. If any of the given types
- * don't have indices associated with them, this method will create
- * the appropriate index.
- * @param types the logical structure types
- * @return the string representing the given combination of logical
- * structure types
- */
- protected String getComboString(ILogicalStructureType[] types) {
- StringBuilder comboKey= new StringBuilder();
- for (int i = 0; i < types.length; i++) {
- ILogicalStructureType type = types[i];
- int typeIndex = fStructureTypeIds.indexOf(type.getId());
- if (typeIndex == -1) {
- typeIndex= fStructureTypeIds.size();
- fStructureTypeIds.add(type.getId());
- }
- comboKey.append(typeIndex).append(',');
- }
- return comboKey.toString();
- }
+ /**
+ * Returns the string representing the given combination of logical
+ * structure types. This string will be a series of comma-separated
+ * indices representing the various types. If any of the given types
+ * don't have indices associated with them, this method will create
+ * the appropriate index.
+ * @param types the logical structure types
+ * @return the string representing the given combination of logical
+ * structure types
+ */
+ protected String getComboString(ILogicalStructureType[] types) {
+ StringBuilder comboKey= new StringBuilder();
+ for (int i = 0; i < types.length; i++) {
+ ILogicalStructureType type = types[i];
+ int typeIndex = fStructureTypeIds.indexOf(type.getId());
+ if (typeIndex == -1) {
+ typeIndex= fStructureTypeIds.size();
+ fStructureTypeIds.add(type.getId());
+ }
+ comboKey.append(typeIndex).append(',');
+ }
+ return comboKey.toString();
+ }
private synchronized void initialize() {
if (fTypes == null) {
@@ -269,11 +269,11 @@ public class LogicalStructureManager {
}
}
}
- if (fStructureTypeSelections == null) {
- loadStructureTypeSelections();
- }
- if (fStructureTypeIds == null) {
- loadStructureTypeIds();
- }
+ if (fStructureTypeSelections == null) {
+ loadStructureTypeSelections();
+ }
+ if (fStructureTypeIds == null) {
+ loadStructureTypeIds();
+ }
}
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java
index 0d801a2b0..470438bbe 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java
@@ -131,16 +131,16 @@ public class LogicalStructureType implements ILogicalStructureType {
return d2.getDescription(value);
}
if (!fVerifiedDescription) {
- fVerifiedDescription = true;
- try {
- verifyAttributeExists(IConfigurationElementConstants.DESCRIPTION);
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
+ fVerifiedDescription = true;
+ try {
+ verifyAttributeExists(IConfigurationElementConstants.DESCRIPTION);
+ } catch (CoreException e) {
+ DebugPlugin.log(e);
+ }
}
String description = getDescription();
if (description == null) {
- return DebugCoreMessages.LogicalStructureType_0;
+ return DebugCoreMessages.LogicalStructureType_0;
}
return description;
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java
index e787aab35..65d9d71aa 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java
@@ -87,7 +87,7 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
for (int i= 0; i < copiedListeners.length; i++) {
fListener = (IMemoryBlockListener)copiedListeners[i];
fMemoryBlocks = memBlocks;
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
}
fListener = null;
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
index 5abe88d65..9a399e27d 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
@@ -21,41 +21,41 @@ import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.core.model.IStreamsProxy2;
public class NullStreamsProxy implements IStreamsProxy2 {
- private NullStreamMonitor outputStreamMonitor;
- private NullStreamMonitor errorStreamMonitor;
+ private NullStreamMonitor outputStreamMonitor;
+ private NullStreamMonitor errorStreamMonitor;
- public NullStreamsProxy(Process process) {
- outputStreamMonitor = new NullStreamMonitor(process.getInputStream());
- errorStreamMonitor = new NullStreamMonitor(process.getErrorStream());
- }
+ public NullStreamsProxy(Process process) {
+ outputStreamMonitor = new NullStreamMonitor(process.getInputStream());
+ errorStreamMonitor = new NullStreamMonitor(process.getErrorStream());
+ }
- @Override
+ @Override
public void closeInputStream() throws IOException {
- }
+ }
- @Override
+ @Override
public IStreamMonitor getErrorStreamMonitor() {
- return errorStreamMonitor;
- }
+ return errorStreamMonitor;
+ }
- @Override
+ @Override
public IStreamMonitor getOutputStreamMonitor() {
- return outputStreamMonitor;
- }
+ return outputStreamMonitor;
+ }
- @Override
+ @Override
public void write(String input) throws IOException {
- }
+ }
- private class NullStreamMonitor implements IStreamMonitor {
- private InputStream fStream;
+ private class NullStreamMonitor implements IStreamMonitor {
+ private InputStream fStream;
- public NullStreamMonitor(InputStream stream) {
- fStream = stream;
- startReaderThread();
- }
+ public NullStreamMonitor(InputStream stream) {
+ fStream = stream;
+ startReaderThread();
+ }
- private void startReaderThread() {
+ private void startReaderThread() {
Thread thread = new Thread((Runnable) () -> {
byte[] bytes = new byte[1024];
try {
@@ -65,22 +65,22 @@ public class NullStreamsProxy implements IStreamsProxy2 {
} catch (IOException e) {
}
}, DebugCoreMessages.NullStreamsProxy_0);
- thread.setDaemon(true);
- thread.start();
+ thread.setDaemon(true);
+ thread.start();
- }
+ }
- @Override
+ @Override
public void addListener(IStreamListener listener) {
- }
+ }
- @Override
+ @Override
public String getContents() {
- return ""; //$NON-NLS-1$
- }
+ return ""; //$NON-NLS-1$
+ }
- @Override
+ @Override
public void removeListener(IStreamListener listener) {
- }
- }
+ }
+ }
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java
index f5c536ee1..c7dfd261b 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java
@@ -52,7 +52,7 @@ public class PreferredDelegateModifyListener extends PreferenceModifyListener {
// force VMs to be initialized before we import the new VMs
node.accept(new Visitor());
} catch (BackingStoreException e) {
- DebugPlugin.log(e);
+ DebugPlugin.log(e);
}
return node;
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java
index 9830a8179..5bb348746 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java
@@ -27,36 +27,36 @@ import org.eclipse.core.runtime.Path;
*/
public class ResourceFactory {
- // These persistence constants are stored in XML. Do not
- // change them.
- public static final String TAG_PATH = "path";//$NON-NLS-1$
+ // These persistence constants are stored in XML. Do not
+ // change them.
+ public static final String TAG_PATH = "path";//$NON-NLS-1$
- public static final String TAG_TYPE = "type";//$NON-NLS-1$
+ public static final String TAG_TYPE = "type";//$NON-NLS-1$
- /**
- * Creates and returns an element based on the given memento
- *
- * @param memento element memento
- * @return associated element
- */
- public static IAdaptable createElement(XMLMemento memento) {
- // Get the file name.
- String fileName = memento.getString(TAG_PATH);
- if (fileName == null) {
+ /**
+ * Creates and returns an element based on the given memento
+ *
+ * @param memento element memento
+ * @return associated element
+ */
+ public static IAdaptable createElement(XMLMemento memento) {
+ // Get the file name.
+ String fileName = memento.getString(TAG_PATH);
+ if (fileName == null) {
return null;
}
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- String type = memento.getString(TAG_TYPE);
- IResource res = null;
- if (type == null) {
- // Old format memento. Create an IResource using findMember.
- // Will return null for resources in closed projects.
- res = root.findMember(new Path(fileName));
- } else {
- int resourceType = Integer.parseInt(type);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ String type = memento.getString(TAG_TYPE);
+ IResource res = null;
+ if (type == null) {
+ // Old format memento. Create an IResource using findMember.
+ // Will return null for resources in closed projects.
+ res = root.findMember(new Path(fileName));
+ } else {
+ int resourceType = Integer.parseInt(type);
- if (resourceType == IResource.ROOT) {
+ if (resourceType == IResource.ROOT) {
res = root;
} else if (resourceType == IResource.PROJECT) {
res = root.getProject(fileName);
@@ -65,12 +65,12 @@ public class ResourceFactory {
} else if (resourceType == IResource.FILE) {
res = root.getFile(new Path(fileName));
}
- }
- return res;
- }
+ }
+ return res;
+ }
- public static void saveState(XMLMemento memento, IResource res) {
- memento.putString(TAG_PATH, res.getFullPath().toString());
- memento.putString(TAG_TYPE, Integer.toString(res.getType()));
- }
+ public static void saveState(XMLMemento memento, IResource res) {
+ memento.putString(TAG_PATH, res.getFullPath().toString());
+ memento.putString(TAG_TYPE, Integer.toString(res.getType()));
+ }
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
index c3fab169f..616e79674 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java
@@ -86,11 +86,11 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
* @return Returns whether the stream proxy was already closed.
*/
private synchronized boolean isClosed(boolean setClosed) {
- boolean closed = fClosed;
- if (setClosed) {
- fClosed = true;
- }
- return closed;
+ boolean closed = fClosed;
+ if (setClosed) {
+ fClosed = true;
+ }
+ return closed;
}
/**
@@ -100,9 +100,9 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
* Data remaining in the streams is lost.
*/
public void kill() {
- synchronized (this) {
- fClosed= true;
- }
+ synchronized (this) {
+ fClosed= true;
+ }
fOutputMonitor.kill();
fErrorMonitor.kill();
fInputMonitor.close();
@@ -127,14 +127,14 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
}
}
- @Override
+ @Override
public void closeInputStream() throws IOException {
- if (!isClosed(false)) {
- fInputMonitor.closeInputStream();
- } else {
- throw new IOException();
- }
+ if (!isClosed(false)) {
+ fInputMonitor.closeInputStream();
+ } else {
+ throw new IOException();
+ }
- }
+ }
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
index 3e66c8483..9a942eb6e 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java
@@ -213,7 +213,7 @@ public class WatchExpression implements IWatchExpression {
public ILaunch getLaunch() {
IDebugTarget debugTarget = getDebugTarget();
if (debugTarget != null) {
- return debugTarget.getLaunch();
+ return debugTarget.getLaunch();
}
return null;
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
index c2c59ad0e..d8b6fe817 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java
@@ -39,227 +39,227 @@ import org.xml.sax.SAXException;
* An XML memento. Copied from workspace plug-in.
*/
public final class XMLMemento {
- private Document factory;
-
- private Element element;
-
- /**
- * Creates a <code>Document</code> from the <code>Reader</code>
- * and returns a memento on the first <code>Element</code> for reading
- * the document.
- * <p>
- * Same as calling createReadRoot(reader, null)
- * </p>
- *
- * @param reader the <code>Reader</code> used to create the memento's document
- * @return a memento on the first <code>Element</code> for reading the document
- * @throws Exception if IO problems, invalid format, or no element.
- */
- public static XMLMemento createReadRoot(Reader reader)
- throws Exception {
- return createReadRoot(reader, null);
- }
-
- /**
- * Creates a <code>Document</code> from the <code>Reader</code>
- * and returns a memento on the first <code>Element</code> for reading
- * the document.
- *
- * @param reader the <code>Reader</code> used to create the memento's document
- * @param baseDir the directory used to resolve relative file names
- * in the XML document. This directory must exist and include the
- * trailing separator. The directory format, including the separators,
- * must be valid for the platform. Can be <code>null</code> if not
- * needed.
- * @return a memento on the first <code>Element</code> for reading the document
- * @throws Exception if IO problems, invalid format, or no element.
- */
- public static XMLMemento createReadRoot(Reader reader, String baseDir)
- throws Exception {
- String errorMessage = null;
- Exception exception = null;
-
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory
- .newInstance();
- DocumentBuilder parser = factory.newDocumentBuilder();
- InputSource source = new InputSource(reader);
- if (baseDir != null) {
+ private Document factory;
+
+ private Element element;
+
+ /**
+ * Creates a <code>Document</code> from the <code>Reader</code>
+ * and returns a memento on the first <code>Element</code> for reading
+ * the document.
+ * <p>
+ * Same as calling createReadRoot(reader, null)
+ * </p>
+ *
+ * @param reader the <code>Reader</code> used to create the memento's document
+ * @return a memento on the first <code>Element</code> for reading the document
+ * @throws Exception if IO problems, invalid format, or no element.
+ */
+ public static XMLMemento createReadRoot(Reader reader)
+ throws Exception {
+ return createReadRoot(reader, null);
+ }
+
+ /**
+ * Creates a <code>Document</code> from the <code>Reader</code>
+ * and returns a memento on the first <code>Element</code> for reading
+ * the document.
+ *
+ * @param reader the <code>Reader</code> used to create the memento's document
+ * @param baseDir the directory used to resolve relative file names
+ * in the XML document. This directory must exist and include the
+ * trailing separator. The directory format, including the separators,
+ * must be valid for the platform. Can be <code>null</code> if not
+ * needed.
+ * @return a memento on the first <code>Element</code> for reading the document
+ * @throws Exception if IO problems, invalid format, or no element.
+ */
+ public static XMLMemento createReadRoot(Reader reader, String baseDir)
+ throws Exception {
+ String errorMessage = null;
+ Exception exception = null;
+
+ try {
+ DocumentBuilderFactory factory = DocumentBuilderFactory
+ .newInstance();
+ DocumentBuilder parser = factory.newDocumentBuilder();
+ InputSource source = new InputSource(reader);
+ if (baseDir != null) {
source.setSystemId(baseDir);
}
- Document document = parser.parse(source);
- NodeList list = document.getChildNodes();
- for (int i = 0; i < list.getLength(); i++) {
- Node node = list.item(i);
- if (node instanceof Element) {
+ Document document = parser.parse(source);
+ NodeList list = document.getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if (node instanceof Element) {
return new XMLMemento(document, (Element) node);
}
- }
- } catch (ParserConfigurationException e) {
- exception = e;
- // errorMessage = WorkbenchMessages.XMLMemento_parserConfigError;
- } catch (IOException e) {
- exception = e;
- // errorMessage = WorkbenchMessages.XMLMemento_ioError;
- } catch (SAXException e) {
- exception = e;
- // errorMessage = WorkbenchMessages.XMLMemento_formatError;
- }
-
- String problemText = null;
- if (exception != null) {
+ }
+ } catch (ParserConfigurationException e) {
+ exception = e;
+ // errorMessage = WorkbenchMessages.XMLMemento_parserConfigError;
+ } catch (IOException e) {
+ exception = e;
+ // errorMessage = WorkbenchMessages.XMLMemento_ioError;
+ } catch (SAXException e) {
+ exception = e;
+ // errorMessage = WorkbenchMessages.XMLMemento_formatError;
+ }
+
+ String problemText = null;
+ if (exception != null) {
problemText = exception.getMessage();
}
- if (problemText == null || problemText.length() == 0) {
+ if (problemText == null || problemText.length() == 0) {
problemText = errorMessage != null ? errorMessage
- :"ERROR"; //;WorkbenchMessages.XMLMemento_noElement; //$NON-NLS-1$
- }
- throw new Exception(problemText, exception);
- }
-
- /**
- * Returns a root memento for writing a document.
- *
- * @param type the element node type to create on the document
- * @return the root memento for writing a document
- */
- public static XMLMemento createWriteRoot(String type) {
- Document document;
- try {
- document = DocumentBuilderFactory.newInstance()
- .newDocumentBuilder().newDocument();
- Element element = document.createElement(type);
- document.appendChild(element);
- return new XMLMemento(document, element);
- } catch (ParserConfigurationException e) {
+ :"ERROR"; //;WorkbenchMessages.XMLMemento_noElement; //$NON-NLS-1$
+ }
+ throw new Exception(problemText, exception);
+ }
+
+ /**
+ * Returns a root memento for writing a document.
+ *
+ * @param type the element node type to create on the document
+ * @return the root memento for writing a document
+ */
+ public static XMLMemento createWriteRoot(String type) {
+ Document document;
+ try {
+ document = DocumentBuilderFactory.newInstance()
+ .newDocumentBuilder().newDocument();
+ Element element = document.createElement(type);
+ document.appendChild(element);
+ return new XMLMemento(document, element);
+ } catch (ParserConfigurationException e) {
// throw new Error(e);
- throw new Error(e.getMessage());
- }
- }
-
- /**
- * Creates a memento for the specified document and element.
- * <p>
- * Clients should use <code>createReadRoot</code> and
- * <code>createWriteRoot</code> to create the initial
- * memento on a document.
- * </p>
- *
- * @param document the document for the memento
- * @param element the element node for the memento
- */
- public XMLMemento(Document document, Element element) {
- super();
- this.factory = document;
- this.element = element;
- }
+ throw new Error(e.getMessage());
+ }
+ }
+
+ /**
+ * Creates a memento for the specified document and element.
+ * <p>
+ * Clients should use <code>createReadRoot</code> and
+ * <code>createWriteRoot</code> to create the initial
+ * memento on a document.
+ * </p>
+ *
+ * @param document the document for the memento
+ * @param element the element node for the memento
+ */
+ public XMLMemento(Document document, Element element) {
+ super();
+ this.factory = document;
+ this.element = element;
+ }
/*
* Method declared in XMLMemento.
*/
- public XMLMemento createChild(String type) {
- Element child = factory.createElement(type);
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
+ public XMLMemento createChild(String type) {
+ Element child = factory.createElement(type);
+ element.appendChild(child);
+ return new XMLMemento(factory, child);
+ }
/*
* Method declared in XMLMemento.
*/
- public XMLMemento createChild(String type, String id) {
- Element child = factory.createElement(type);
- child.setAttribute(IMementoConstants.TAG_ID, id == null ? "" : id); //$NON-NLS-1$
- element.appendChild(child);
- return new XMLMemento(factory, child);
- }
+ public XMLMemento createChild(String type, String id) {
+ Element child = factory.createElement(type);
+ child.setAttribute(IMementoConstants.TAG_ID, id == null ? "" : id); //$NON-NLS-1$
+ element.appendChild(child);
+ return new XMLMemento(factory, child);
+ }
/*
* Method declared in XMLMemento.
*/
- public XMLMemento copyChild(XMLMemento child) {
- Element childElement = child.element;
- Element newElement = (Element) factory.importNode(childElement, true);
- element.appendChild(newElement);
- return new XMLMemento(factory, newElement);
- }
+ public XMLMemento copyChild(XMLMemento child) {
+ Element childElement = child.element;
+ Element newElement = (Element) factory.importNode(childElement, true);
+ element.appendChild(newElement);
+ return new XMLMemento(factory, newElement);
+ }
/*
* Method declared in XMLMemento.
*/
- public XMLMemento getChild(String type) {
+ public XMLMemento getChild(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0) {
+ // Get the nodes.
+ NodeList nodes = element.getChildNodes();
+ int size = nodes.getLength();
+ if (size == 0) {
return null;
}
- // Find the first node which is a child of this node.
- for (int nX = 0; nX < size; nX++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element1 = (Element) node;
- if (element1.getNodeName().equals(type)) {
+ // Find the first node which is a child of this node.
+ for (int nX = 0; nX < size; nX++) {
+ Node node = nodes.item(nX);
+ if (node instanceof Element) {
+ Element element1 = (Element) node;
+ if (element1.getNodeName().equals(type)) {
return new XMLMemento(factory, element1);
}
- }
- }
+ }
+ }
- // A child was not found.
- return null;
- }
+ // A child was not found.
+ return null;
+ }
/*
* Method declared in XMLMemento.
*/
- public XMLMemento[] getChildren(String type) {
+ public XMLMemento[] getChildren(String type) {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0) {
+ // Get the nodes.
+ NodeList nodes = element.getChildNodes();
+ int size = nodes.getLength();
+ if (size == 0) {
return new XMLMemento[0];
}
- // Extract each node with given type.
+ // Extract each node with given type.
ArrayList<Element> list = new ArrayList<>(size);
- for (int nX = 0; nX < size; nX++) {
- Node node = nodes.item(nX);
- if (node instanceof Element) {
- Element element1 = (Element) node;
- if (element1.getNodeName().equals(type)) {
+ for (int nX = 0; nX < size; nX++) {
+ Node node = nodes.item(nX);
+ if (node instanceof Element) {
+ Element element1 = (Element) node;
+ if (element1.getNodeName().equals(type)) {
list.add(element1);
}
- }
- }
-
- // Create a memento for each node.
- size = list.size();
- XMLMemento[] results = new XMLMemento[size];
- for (int x = 0; x < size; x++) {
- results[x] = new XMLMemento(factory, list.get(x));
- }
- return results;
- }
+ }
+ }
+
+ // Create a memento for each node.
+ size = list.size();
+ XMLMemento[] results = new XMLMemento[size];
+ for (int x = 0; x < size; x++) {
+ results[x] = new XMLMemento(factory, list.get(x));
+ }
+ return results;
+ }
/*
* Method declared in XMLMemento.
*/
- public Float getFloat(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null) {
+ public Float getFloat(String key) {
+ Attr attr = element.getAttributeNode(key);
+ if (attr == null) {
+ return null;
+ }
+ String strValue = attr.getValue();
+ try {
+ return Float.valueOf(strValue);
+ } catch (NumberFormatException e) {
+ DebugPlugin.logMessage("Memento problem - Invalid float for key: " //$NON-NLS-1$
+ + key + " value: " + strValue, e); //$NON-NLS-1$
return null;
}
- String strValue = attr.getValue();
- try {
- return Float.valueOf(strValue);
- } catch (NumberFormatException e) {
- DebugPlugin.logMessage("Memento problem - Invalid float for key: " //$NON-NLS-1$
- + key + " value: " + strValue, e); //$NON-NLS-1$
- return null;
- }
- }
+ }
public String getType() {
return element.getNodeName();
@@ -268,58 +268,58 @@ public final class XMLMemento {
/*
* Method declared in XMLMemento.
*/
- public String getID() {
- return element.getAttribute(IMementoConstants.TAG_ID);
- }
+ public String getID() {
+ return element.getAttribute(IMementoConstants.TAG_ID);
+ }
/*
* Method declared in XMLMemento.
*/
- public Integer getInteger(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null) {
+ public Integer getInteger(String key) {
+ Attr attr = element.getAttributeNode(key);
+ if (attr == null) {
return null;
}
- String strValue = attr.getValue();
- try {
- return Integer.valueOf(strValue);
- } catch (NumberFormatException e) {
- DebugPlugin
- .logMessage("Memento problem - invalid integer for key: " + key //$NON-NLS-1$
- + " value: " + strValue, e); //$NON-NLS-1$
- return null;
- }
- }
+ String strValue = attr.getValue();
+ try {
+ return Integer.valueOf(strValue);
+ } catch (NumberFormatException e) {
+ DebugPlugin
+ .logMessage("Memento problem - invalid integer for key: " + key //$NON-NLS-1$
+ + " value: " + strValue, e); //$NON-NLS-1$
+ return null;
+ }
+ }
/*
* Method declared in XMLMemento.
*/
- public String getString(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null) {
+ public String getString(String key) {
+ Attr attr = element.getAttributeNode(key);
+ if (attr == null) {
return null;
}
- return attr.getValue();
- }
+ return attr.getValue();
+ }
public Boolean getBoolean(String key) {
- Attr attr = element.getAttributeNode(key);
- if (attr == null) {
+ Attr attr = element.getAttributeNode(key);
+ if (attr == null) {
return null;
}
- return Boolean.valueOf(attr.getValue());
+ return Boolean.valueOf(attr.getValue());
}
/*
* Method declared in XMLMemento.
*/
- public String getTextData() {
- Text textNode = getTextNode();
- if (textNode != null) {
- return textNode.getData();
- }
- return null;
- }
+ public String getTextData() {
+ Text textNode = getTextNode();
+ if (textNode != null) {
+ return textNode.getData();
+ }
+ return null;
+ }
public String[] getAttributeKeys() {
NamedNodeMap map = element.getAttributes();
@@ -332,92 +332,92 @@ public final class XMLMemento {
return attributes;
}
- /**
- * Returns the Text node of the memento. Each memento is allowed only
- * one Text node.
- *
- * @return the Text node of the memento, or <code>null</code> if
- * the memento has no Text node.
- */
- private Text getTextNode() {
- // Get the nodes.
- NodeList nodes = element.getChildNodes();
- int size = nodes.getLength();
- if (size == 0) {
+ /**
+ * Returns the Text node of the memento. Each memento is allowed only
+ * one Text node.
+ *
+ * @return the Text node of the memento, or <code>null</code> if
+ * the memento has no Text node.
+ */
+ private Text getTextNode() {
+ // Get the nodes.
+ NodeList nodes = element.getChildNodes();
+ int size = nodes.getLength();
+ if (size == 0) {
return null;
}
- for (int nX = 0; nX < size; nX++) {
- Node node = nodes.item(nX);
- if (node instanceof Text) {
- return (Text) node;
- }
- }
- // a Text node was not found
- return null;
- }
-
- /**
- * Places the element's attributes into the document.
- * @param element1 the element
- * @param copyText true if the first text node should be copied
- */
- private void putElement(Element element1, boolean copyText) {
- NamedNodeMap nodeMap = element1.getAttributes();
- int size = nodeMap.getLength();
- for (int i = 0; i < size; i++) {
- Attr attr = (Attr) nodeMap.item(i);
- putString(attr.getName(), attr.getValue());
- }
-
- NodeList nodes = element1.getChildNodes();
- size = nodes.getLength();
- // Copy first text node (fixes bug 113659).
- // Note that text data will be added as the first child (see putTextData)
- boolean needToCopyText = copyText;
- for (int i = 0; i < size; i++) {
- Node node = nodes.item(i);
- if (node instanceof Element) {
- XMLMemento child = createChild(node.getNodeName());
- child.putElement((Element) node, true);
- } else if (node instanceof Text && needToCopyText) {
- putTextData(((Text) node).getData());
- needToCopyText = false;
- }
- }
- }
+ for (int nX = 0; nX < size; nX++) {
+ Node node = nodes.item(nX);
+ if (node instanceof Text) {
+ return (Text) node;
+ }
+ }
+ // a Text node was not found
+ return null;
+ }
+
+ /**
+ * Places the element's attributes into the document.
+ * @param element1 the element
+ * @param copyText true if the first text node should be copied
+ */
+ private void putElement(Element element1, boolean copyText) {
+ NamedNodeMap nodeMap = element1.getAttributes();
+ int size = nodeMap.getLength();
+ for (int i = 0; i < size; i++) {
+ Attr attr = (Attr) nodeMap.item(i);
+ putString(attr.getName(), attr.getValue());
+ }
+
+ NodeList nodes = element1.getChildNodes();
+ size = nodes.getLength();
+ // Copy first text node (fixes bug 113659).
+ // Note that text data will be added as the first child (see putTextData)
+ boolean needToCopyText = copyText;
+ for (int i = 0; i < size; i++) {
+ Node node = nodes.item(i);
+ if (node instanceof Element) {
+ XMLMemento child = createChild(node.getNodeName());
+ child.putElement((Element) node, true);
+ } else if (node instanceof Text && needToCopyText) {
+ putTextData(((Text) node).getData());
+ needToCopyText = false;
+ }
+ }
+ }
/*
* Method declared in XMLMemento.
*/
- public void putFloat(String key, float f) {
- element.setAttribute(key, String.valueOf(f));
- }
+ public void putFloat(String key, float f) {
+ element.setAttribute(key, String.valueOf(f));
+ }
/*
* Method declared in XMLMemento.
*/
- public void putInteger(String key, int n) {
- element.setAttribute(key, String.valueOf(n));
- }
+ public void putInteger(String key, int n) {
+ element.setAttribute(key, String.valueOf(n));
+ }
/*
* Method declared in XMLMemento.
*/
- public void putMemento(XMLMemento memento) {
- // Do not copy the element's top level text node (this would overwrite the existing text).
- // Text nodes of children are copied.
- putElement(memento.element, false);
- }
+ public void putMemento(XMLMemento memento) {
+ // Do not copy the element's top level text node (this would overwrite the existing text).
+ // Text nodes of children are copied.
+ putElement(memento.element, false);
+ }
/*
* Method declared in XMLMemento.
*/
- public void putString(String key, String value) {
- if (value == null) {
+ public void putString(String key, String value) {
+ if (value == null) {
return;
}
- element.setAttribute(key, value);
- }
+ element.setAttribute(key, value);
+ }
/**
* @param key the attribute key
@@ -431,162 +431,162 @@ public final class XMLMemento {
/*
* Method declared in XMLMemento.
*/
- public void putTextData(String data) {
- Text textNode = getTextNode();
- if (textNode == null) {
- textNode = factory.createTextNode(data);
+ public void putTextData(String data) {
+ Text textNode = getTextNode();
+ if (textNode == null) {
+ textNode = factory.createTextNode(data);
// Always add the text node as the first child (fixes bug 93718)
element.insertBefore(textNode, element.getFirstChild());
- } else {
- textNode.setData(data);
- }
- }
-
- /**
- * Saves this memento's document current values to the
- * specified writer.
- *
- * @param writer the writer used to save the memento's document
- * @throws IOException if there is a problem serializing the document to the stream.
- */
- public void save(Writer writer) throws IOException {
+ } else {
+ textNode.setData(data);
+ }
+ }
+
+ /**
+ * Saves this memento's document current values to the
+ * specified writer.
+ *
+ * @param writer the writer used to save the memento's document
+ * @throws IOException if there is a problem serializing the document to the stream.
+ */
+ public void save(Writer writer) throws IOException {
try (DOMWriter out = new DOMWriter(writer)) {
- out.print(element);
+ out.print(element);
}
}
/**
- * A simple XML writer. Using this instead of the javax.xml.transform classes allows
- * compilation against JCL Foundation (bug 80053).
- */
- private static final class DOMWriter extends PrintWriter {
+ * A simple XML writer. Using this instead of the javax.xml.transform classes allows
+ * compilation against JCL Foundation (bug 80053).
+ */
+ private static final class DOMWriter extends PrintWriter {
// private int tab;
- /* constants */
- private static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$
+ /* constants */
+ private static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$
- /**
- * Creates a new DOM writer on the given output writer.
- *
- * @param output the output writer
- */
- public DOMWriter(Writer output) {
- super(output);
+ /**
+ * Creates a new DOM writer on the given output writer.
+ *
+ * @param output the output writer
+ */
+ public DOMWriter(Writer output) {
+ super(output);
// tab = 0;
- println(XML_VERSION);
- }
-
- /**
- * Prints the given element.
- *
- * @param element the element to print
- */
- public void print(Element element) {
- // Ensure extra whitespace is not emitted next to a Text node,
- // as that will result in a situation where the restored text data is not the
- // same as the saved text data.
- boolean hasChildren = element.hasChildNodes();
- startTag(element, hasChildren);
- if (hasChildren) {
+ println(XML_VERSION);
+ }
+
+ /**
+ * Prints the given element.
+ *
+ * @param element the element to print
+ */
+ public void print(Element element) {
+ // Ensure extra whitespace is not emitted next to a Text node,
+ // as that will result in a situation where the restored text data is not the
+ // same as the saved text data.
+ boolean hasChildren = element.hasChildNodes();
+ startTag(element, hasChildren);
+ if (hasChildren) {
// tab++;
- boolean prevWasText = false;
- NodeList children = element.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- if (node instanceof Element) {
- if (!prevWasText) {
- println();
- printTabulation();
- }
- print((Element) children.item(i));
- prevWasText = false;
- }
- else if (node instanceof Text) {
- print(getEscaped(node.getNodeValue()));
- prevWasText = true;
- }
- }
+ boolean prevWasText = false;
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ if (node instanceof Element) {
+ if (!prevWasText) {
+ println();
+ printTabulation();
+ }
+ print((Element) children.item(i));
+ prevWasText = false;
+ }
+ else if (node instanceof Text) {
+ print(getEscaped(node.getNodeValue()));
+ prevWasText = true;
+ }
+ }
// tab--;
- if (!prevWasText) {
- println();
- printTabulation();
- }
- endTag(element);
- }
- }
-
- private void printTabulation() {
- // Indenting is disabled, as it can affect the result of getTextData().
- // In 3.0, elements were separated by a newline but not indented.
- // This causes getTextData() to return "\n" even if no text data had explicitly been set.
- // The code here emulates that behaviour.
+ if (!prevWasText) {
+ println();
+ printTabulation();
+ }
+ endTag(element);
+ }
+ }
+
+ private void printTabulation() {
+ // Indenting is disabled, as it can affect the result of getTextData().
+ // In 3.0, elements were separated by a newline but not indented.
+ // This causes getTextData() to return "\n" even if no text data had explicitly been set.
+ // The code here emulates that behaviour.
// for (int i = 0; i < tab; i++)
// super.print("\t"); //$NON-NLS-1$
- }
-
- private void startTag(Element element, boolean hasChildren) {
- StringBuilder sb = new StringBuilder();
- sb.append("<"); //$NON-NLS-1$
- sb.append(element.getTagName());
- NamedNodeMap attributes = element.getAttributes();
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attribute = (Attr)attributes.item(i);
+ }
+
+ private void startTag(Element element, boolean hasChildren) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<"); //$NON-NLS-1$
+ sb.append(element.getTagName());
+ NamedNodeMap attributes = element.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Attr attribute = (Attr)attributes.item(i);
sb.append(" "); //$NON-NLS-1$
sb.append(attribute.getName());
sb.append("=\""); //$NON-NLS-1$
sb.append(getEscaped(String.valueOf(attribute.getValue())));
sb.append("\""); //$NON-NLS-1$
- }
- sb.append(hasChildren ? ">" : "/>"); //$NON-NLS-1$ //$NON-NLS-2$
- print(sb.toString());
- }
-
- private void endTag(Element element) {
- StringBuilder sb = new StringBuilder();
- sb.append("</"); //$NON-NLS-1$
- sb.append(element.getNodeName());
- sb.append(">"); //$NON-NLS-1$
- print(sb.toString());
- }
-
- private static void appendEscapedChar(StringBuilder buffer, char c) {
- String replacement = getReplacement(c);
- if (replacement != null) {
- buffer.append('&');
- buffer.append(replacement);
- buffer.append(';');
- } else if (c==9 || c==10 || c==13 || c>=32){
- buffer.append(c);
- }
- }
-
- private static String getEscaped(String s) {
- StringBuilder result = new StringBuilder(s.length() + 10);
- for (int i = 0; i < s.length(); ++i) {
+ }
+ sb.append(hasChildren ? ">" : "/>"); //$NON-NLS-1$ //$NON-NLS-2$
+ print(sb.toString());
+ }
+
+ private void endTag(Element element) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("</"); //$NON-NLS-1$
+ sb.append(element.getNodeName());
+ sb.append(">"); //$NON-NLS-1$
+ print(sb.toString());
+ }
+
+ private static void appendEscapedChar(StringBuilder buffer, char c) {
+ String replacement = getReplacement(c);
+ if (replacement != null) {
+ buffer.append('&');
+ buffer.append(replacement);
+ buffer.append(';');
+ } else if (c==9 || c==10 || c==13 || c>=32){
+ buffer.append(c);
+ }
+ }
+
+ private static String getEscaped(String s) {
+ StringBuilder result = new StringBuilder(s.length() + 10);
+ for (int i = 0; i < s.length(); ++i) {
appendEscapedChar(result, s.charAt(i));
}
- return result.toString();
- }
+ return result.toString();
+ }
- private static String getReplacement(char c) {
- // Encode special XML characters into the equivalent character references.
+ private static String getReplacement(char c) {
+ // Encode special XML characters into the equivalent character references.
// The first five are defined by default for all XML documents.
// The next three (#xD, #xA, #x9) are encoded to avoid them
// being converted to spaces on deserialization
// (fixes bug 93720)
- switch (c) {
- case '<' :
- return "lt"; //$NON-NLS-1$
- case '>' :
- return "gt"; //$NON-NLS-1$
- case '"' :
- return "quot"; //$NON-NLS-1$
- case '\'' :
- return "apos"; //$NON-NLS-1$
- case '&' :
- return "amp"; //$NON-NLS-1$
+ switch (c) {
+ case '<' :
+ return "lt"; //$NON-NLS-1$
+ case '>' :
+ return "gt"; //$NON-NLS-1$
+ case '"' :
+ return "quot"; //$NON-NLS-1$
+ case '\'' :
+ return "apos"; //$NON-NLS-1$
+ case '&' :
+ return "amp"; //$NON-NLS-1$
case '\r':
return "#x0D"; //$NON-NLS-1$
case '\n':
@@ -595,8 +595,8 @@ public final class XMLMemento {
return "#x09"; //$NON-NLS-1$
default:
break;
- }
- return null;
- }
- }
+ }
+ return null;
+ }
+ }
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java
index 1db82aa0a..7ac3e1cea 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java
@@ -48,10 +48,10 @@ public class StepFiltersCommand extends ForEachCommand implements IStepFiltersHa
}
return filters;
}
- return null;
+ return null;
}
- private IDebugTarget[] getDebugTargets(Object element) {
+ private IDebugTarget[] getDebugTargets(Object element) {
if (element instanceof IDebugElement) {
IDebugElement debugElement = (IDebugElement) element;
return new IDebugTarget[] { debugElement.getDebugTarget() };
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/ProcessObserver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/ProcessObserver.java
index e1d29bbb3..c20aad296 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/ProcessObserver.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/ProcessObserver.java
@@ -25,33 +25,33 @@ import org.eclipse.debug.core.model.IProcess;
* a {@linkplain CountDownLatch synchronization object} when the process terminates.
*/
public final class ProcessObserver implements Callable<Integer> {
- private final IProcess p;
- private final IProgressMonitor pMonitor;
- private final CountDownLatch countDownLatch;
+ private final IProcess p;
+ private final IProgressMonitor pMonitor;
+ private final CountDownLatch countDownLatch;
- public ProcessObserver(IProgressMonitor monitor, IProcess p, CountDownLatch countDownLatch) {
- this.p = p;
- this.pMonitor = monitor;
- this.countDownLatch = countDownLatch;
- }
+ public ProcessObserver(IProgressMonitor monitor, IProcess p, CountDownLatch countDownLatch) {
+ this.p = p;
+ this.pMonitor = monitor;
+ this.countDownLatch = countDownLatch;
+ }
- @Override
- public Integer call() throws Exception {
- try {
- while (!p.isTerminated() && !pMonitor.isCanceled()) {
- TimeUnit.MILLISECONDS.sleep(250);
+ @Override
+ public Integer call() throws Exception {
+ try {
+ while (!p.isTerminated() && !pMonitor.isCanceled()) {
+ TimeUnit.MILLISECONDS.sleep(250);
- if (countDownLatch.getCount() == 0) {
- break;
- }
- }
- // check if terminated or timeout
- if (p.isTerminated()) {
- return p.getExitValue();
- }
- return 0;
- } finally {
- countDownLatch.countDown();
- }
- }
+ if (countDownLatch.getCount() == 0) {
+ break;
+ }
+ }
+ // check if terminated or timeout
+ if (p.isTerminated()) {
+ return p.getExitValue();
+ }
+ return 0;
+ } finally {
+ countDownLatch.countDown();
+ }
+ }
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/StreamObserver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/StreamObserver.java
index 9e1a227f0..f7c08c78c 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/StreamObserver.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/observer/StreamObserver.java
@@ -29,48 +29,48 @@ import org.eclipse.debug.core.model.IStreamsProxy;
* output.
*/
public class StreamObserver implements Runnable {
- private final String stringPattern;
- private final IProcess process;
- private final CountDownLatch countDownLatch;
- private final IProgressMonitor pMonitor;
+ private final String stringPattern;
+ private final IProcess process;
+ private final CountDownLatch countDownLatch;
+ private final IProgressMonitor pMonitor;
- public StreamObserver(IProgressMonitor monitor, IProcess process, String pattern,
- CountDownLatch countDownLatch) {
- this.process = process;
- this.pMonitor = monitor;
- this.stringPattern = pattern;
- this.countDownLatch = countDownLatch;
- }
+ public StreamObserver(IProgressMonitor monitor, IProcess process, String pattern,
+ CountDownLatch countDownLatch) {
+ this.process = process;
+ this.pMonitor = monitor;
+ this.stringPattern = pattern;
+ this.countDownLatch = countDownLatch;
+ }
- @Override
- public void run() {
- // append wild card if not provided
- StringBuilder patternBuilder = new StringBuilder();
- if (!stringPattern.startsWith(".*")) { //$NON-NLS-1$
- patternBuilder.append(".*"); //$NON-NLS-1$
- }
- patternBuilder.append(stringPattern);
- if (!stringPattern.endsWith(".*")) { //$NON-NLS-1$
- patternBuilder.append(".*"); //$NON-NLS-1$
- }
- // create pattern and start listening to the output
- final Pattern pattern = Pattern.compile(patternBuilder.toString(), Pattern.MULTILINE);
- final IStreamMonitor outputStreamMonitor = process.getStreamsProxy()
- .getOutputStreamMonitor();
- outputStreamMonitor.addListener(new IStreamListener() {
- @Override
- public void streamAppended(String text, IStreamMonitor monitor) {
- if (countDownLatch.getCount() == 0) {
- outputStreamMonitor.removeListener(this);
- return;
- }
+ @Override
+ public void run() {
+ // append wild card if not provided
+ StringBuilder patternBuilder = new StringBuilder();
+ if (!stringPattern.startsWith(".*")) { //$NON-NLS-1$
+ patternBuilder.append(".*"); //$NON-NLS-1$
+ }
+ patternBuilder.append(stringPattern);
+ if (!stringPattern.endsWith(".*")) { //$NON-NLS-1$
+ patternBuilder.append(".*"); //$NON-NLS-1$
+ }
+ // create pattern and start listening to the output
+ final Pattern pattern = Pattern.compile(patternBuilder.toString(), Pattern.MULTILINE);
+ final IStreamMonitor outputStreamMonitor = process.getStreamsProxy()
+ .getOutputStreamMonitor();
+ outputStreamMonitor.addListener(new IStreamListener() {
+ @Override
+ public void streamAppended(String text, IStreamMonitor monitor) {
+ if (countDownLatch.getCount() == 0) {
+ outputStreamMonitor.removeListener(this);
+ return;
+ }
- Matcher matcher = pattern.matcher(text);
- if (!matcher.find() && !pMonitor.isCanceled()) {
- return;
- }
- countDownLatch.countDown();
- }
- });
- }
+ Matcher matcher = pattern.matcher(text);
+ if (!matcher.find() && !pMonitor.isCanceled()) {
+ return;
+ }
+ countDownLatch.countDown();
+ }
+ });
+ }
}
diff --git a/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java b/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java
index f0b3659b2..226aa6015 100644
--- a/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java
+++ b/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java
@@ -45,416 +45,416 @@ import java.util.regex.Pattern;
public class PDAVirtualMachine {
static class Stack extends LinkedList<Object> {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- @Override
+ @Override
public Object pop() {
- return isEmpty() ? Integer.valueOf(0) : remove(size() - 1);
- }
+ return isEmpty() ? Integer.valueOf(0) : remove(size() - 1);
+ }
- @Override
+ @Override
public void push(Object value) {
- add(value);
- }
- }
-
- static class Register {
- Register(String name) {
- fName = name;
- }
- String fName;
- String fGroup = "<no_group>"; //$NON-NLS-1$
- boolean fIsWriteable = true;
+ add(value);
+ }
+ }
+
+ static class Register {
+ Register(String name) {
+ fName = name;
+ }
+ String fName;
+ String fGroup = "<no_group>"; //$NON-NLS-1$
+ boolean fIsWriteable = true;
Map<String, BitField> fBitFields = new LinkedHashMap<>(0);
- int fValue;
- }
-
- static class BitField {
- BitField(String name) {
- fName = name;
- }
- String fName;
- int fBitOffset;
- int fBitCount;
+ int fValue;
+ }
+
+ static class BitField {
+ BitField(String name) {
+ fName = name;
+ }
+ String fName;
+ int fBitOffset;
+ int fBitCount;
Map<String, Integer> fMnemonics = new LinkedHashMap<>(0);
- }
+ }
Map<String, Register> fRegisters = new LinkedHashMap<>(0);
- class Args {
- final String[] fArgs;
-
- int next = 0;
-
- Args(String[] args) {
- fArgs = args;
- }
-
- boolean hasNextArg() {
- return fArgs.length > next;
- }
-
- String getNextStringArg() {
- if (fArgs.length > next) {
- return fArgs[next++];
- }
- return ""; //$NON-NLS-1$
- }
-
- int getNextIntArg() {
- String arg = getNextStringArg();
- try {
- return Integer.parseInt(arg);
- } catch (NumberFormatException e) {
- }
- return 0;
- }
-
- boolean getNextBooleanArg() {
- String arg = getNextStringArg();
- try {
- return Boolean.getBoolean(arg);
- } catch (NumberFormatException e) {
- }
- return false;
- }
-
- Object getNextIntOrStringArg() {
- String arg = getNextStringArg();
- try {
- return Integer.valueOf(arg);
- } catch (NumberFormatException e) {
- }
- return arg;
- }
-
- PDAThread getThreadArg() {
- int id = getNextIntArg();
- return fThreads.get( Integer.valueOf(id) );
- }
- }
-
- class PDAThread {
- final int fID;
-
- /** The push down automata data stack (the data stack). */
- final Stack fStack = new Stack();
-
- /**
- * PDAThread copy of the code. It can differ from the program if
- * performing an evaluation.
- */
- String[] fThreadCode;
-
- /** PDAThread copy of the labels. */
+ class Args {
+ final String[] fArgs;
+
+ int next = 0;
+
+ Args(String[] args) {
+ fArgs = args;
+ }
+
+ boolean hasNextArg() {
+ return fArgs.length > next;
+ }
+
+ String getNextStringArg() {
+ if (fArgs.length > next) {
+ return fArgs[next++];
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ int getNextIntArg() {
+ String arg = getNextStringArg();
+ try {
+ return Integer.parseInt(arg);
+ } catch (NumberFormatException e) {
+ }
+ return 0;
+ }
+
+ boolean getNextBooleanArg() {
+ String arg = getNextStringArg();
+ try {
+ return Boolean.getBoolean(arg);
+ } catch (NumberFormatException e) {
+ }
+ return false;
+ }
+
+ Object getNextIntOrStringArg() {
+ String arg = getNextStringArg();
+ try {
+ return Integer.valueOf(arg);
+ } catch (NumberFormatException e) {
+ }
+ return arg;
+ }
+
+ PDAThread getThreadArg() {
+ int id = getNextIntArg();
+ return fThreads.get( Integer.valueOf(id) );
+ }
+ }
+
+ class PDAThread {
+ final int fID;
+
+ /** The push down automata data stack (the data stack). */
+ final Stack fStack = new Stack();
+
+ /**
+ * PDAThread copy of the code. It can differ from the program if
+ * performing an evaluation.
+ */
+ String[] fThreadCode;
+
+ /** PDAThread copy of the labels. */
Map<String, Integer> fThreadLabels;
- /** The stack of stack frames (the control stack) */
+ /** The stack of stack frames (the control stack) */
final List<Frame> fFrames = new LinkedList<>();
- /** Current stack frame (not includced in fFrames) */
- Frame fCurrentFrame;
+ /** Current stack frame (not includced in fFrames) */
+ Frame fCurrentFrame;
- /**
- * The run flag is true if the thread is running. If the run flag is
- * false, the thread exits the next time the main instruction loop runs.
- */
- boolean fRun = true;
+ /**
+ * The run flag is true if the thread is running. If the run flag is
+ * false, the thread exits the next time the main instruction loop runs.
+ */
+ boolean fRun = true;
- String fSuspend = null;
+ String fSuspend = null;
- boolean fStep = false;
+ boolean fStep = false;
- boolean fStepReturn = false;
+ boolean fStepReturn = false;
- int fSavedPC;
+ int fSavedPC;
- boolean fPerformingEval = false;
+ boolean fPerformingEval = false;
- PDAThread(int id, String function, int pc) {
- fID = id;
- fCurrentFrame = new Frame(function, pc);
- fThreadCode = fCode;
- fThreadLabels = fLabels;
- }
- }
+ PDAThread(int id, String function, int pc) {
+ fID = id;
+ fCurrentFrame = new Frame(function, pc);
+ fThreadCode = fCode;
+ fThreadLabels = fLabels;
+ }
+ }
final Map<Integer, PDAThread> fThreads = new LinkedHashMap<>();
- int fNextThreadId = 1;
+ int fNextThreadId = 1;
- boolean fStarted = true;
- /**
- * The code is stored as an array of strings, each line of the source file
- * being one entry in the array.
- */
- final String[] fCode;
+ boolean fStarted = true;
+ /**
+ * The code is stored as an array of strings, each line of the source file
+ * being one entry in the array.
+ */
+ final String[] fCode;
- /** A mapping of labels to indicies in the code array */
+ /** A mapping of labels to indicies in the code array */
final Map<String, Integer> fLabels;
- /** Each stack frame is a mapping of variable names to values. */
- class Frame {
+ /** Each stack frame is a mapping of variable names to values. */
+ class Frame {
final Map<String, Object> fLocalVariables = new LinkedHashMap<>();
- /**
- * The name of the function in this frame
- */
- final String fFunction;
-
- /**
- * The current program counter in the frame the pc points to the next
- * instruction to be executed
- */
- int fPC;
-
- Frame(String function, int pc) {
- fFunction = function;
- fPC = pc;
- }
-
- void set(String name, Object value) {
- if (name.startsWith("$")) { //$NON-NLS-1$
- setRegisterValue(name, value);
- } else {
- fLocalVariables.put(name, value);
- }
- }
-
- Object get(String name) {
- if (name.startsWith("$")) { //$NON-NLS-1$
- return getRegisterValue(name);
- } else {
- return fLocalVariables.get(name);
- }
- }
- }
-
- void setRegisterValue(String name, Object value) {
- Register reg = fRegisters.get(getRegisterPartOfName(name));
- if (reg == null) {
+ /**
+ * The name of the function in this frame
+ */
+ final String fFunction;
+
+ /**
+ * The current program counter in the frame the pc points to the next
+ * instruction to be executed
+ */
+ int fPC;
+
+ Frame(String function, int pc) {
+ fFunction = function;
+ fPC = pc;
+ }
+
+ void set(String name, Object value) {
+ if (name.startsWith("$")) { //$NON-NLS-1$
+ setRegisterValue(name, value);
+ } else {
+ fLocalVariables.put(name, value);
+ }
+ }
+
+ Object get(String name) {
+ if (name.startsWith("$")) { //$NON-NLS-1$
+ return getRegisterValue(name);
+ } else {
+ return fLocalVariables.get(name);
+ }
+ }
+ }
+
+ void setRegisterValue(String name, Object value) {
+ Register reg = fRegisters.get(getRegisterPartOfName(name));
+ if (reg == null) {
return;
}
- String bitFieldName = getBitFieldPartOfName(name);
- if (bitFieldName != null) {
- BitField bitField = reg.fBitFields.get(bitFieldName);
- if (bitField == null) {
+ String bitFieldName = getBitFieldPartOfName(name);
+ if (bitFieldName != null) {
+ BitField bitField = reg.fBitFields.get(bitFieldName);
+ if (bitField == null) {
return;
}
- Integer intValue = null;
- if (value instanceof Integer) {
- intValue = (Integer)value;
- } else if (value instanceof String) {
- intValue = bitField.fMnemonics.get(value);
- }
- if (intValue != null) {
- int bitFieldMask = 2^(bitField.fBitCount - 1);
- int registerMask = ~(bitFieldMask << bitField.fBitOffset);
- int bitFieldValue = intValue.intValue() & bitFieldMask;
- reg.fValue = (reg.fValue & registerMask) | (bitFieldValue << bitField.fBitOffset);
- }
- } else if (value instanceof Integer) {
- reg.fValue = ((Integer)value).intValue();
- }
- }
-
- Object getRegisterValue(String name) {
- Register reg = fRegisters.get(getRegisterPartOfName(name));
- if (reg == null) {
+ Integer intValue = null;
+ if (value instanceof Integer) {
+ intValue = (Integer)value;
+ } else if (value instanceof String) {
+ intValue = bitField.fMnemonics.get(value);
+ }
+ if (intValue != null) {
+ int bitFieldMask = 2^(bitField.fBitCount - 1);
+ int registerMask = ~(bitFieldMask << bitField.fBitOffset);
+ int bitFieldValue = intValue.intValue() & bitFieldMask;
+ reg.fValue = (reg.fValue & registerMask) | (bitFieldValue << bitField.fBitOffset);
+ }
+ } else if (value instanceof Integer) {
+ reg.fValue = ((Integer)value).intValue();
+ }
+ }
+
+ Object getRegisterValue(String name) {
+ Register reg = fRegisters.get(getRegisterPartOfName(name));
+ if (reg == null) {
return null;
}
- String bitFieldName = getBitFieldPartOfName(name);
- if (bitFieldName != null) {
- BitField bitField = reg.fBitFields.get(bitFieldName);
- if (bitField == null) {
+ String bitFieldName = getBitFieldPartOfName(name);
+ if (bitFieldName != null) {
+ BitField bitField = reg.fBitFields.get(bitFieldName);
+ if (bitField == null) {
return null;
}
- int bitFieldMask = 2^(bitField.fBitCount - 1);
- int registerMask = bitFieldMask << bitField.fBitOffset;
- return Integer.valueOf( (reg.fValue & registerMask) >> bitField.fBitOffset );
- } else {
- return Integer.valueOf(reg.fValue);
- }
- }
-
- /**
- * Breakpoints are stored per each each line of code. The boolean indicates
- * whether the whole VM should suspend or just the triggering thread.
- */
+ int bitFieldMask = 2^(bitField.fBitCount - 1);
+ int registerMask = bitFieldMask << bitField.fBitOffset;
+ return Integer.valueOf( (reg.fValue & registerMask) >> bitField.fBitOffset );
+ } else {
+ return Integer.valueOf(reg.fValue);
+ }
+ }
+
+ /**
+ * Breakpoints are stored per each each line of code. The boolean indicates
+ * whether the whole VM should suspend or just the triggering thread.
+ */
final Map<Integer, Boolean> fBreakpoints = new HashMap<>();
- /**
- * The suspend flag is true if the VM should suspend running the program and
- * just listen for debug commands.
- */
- String fSuspendVM;
+ /**
+ * The suspend flag is true if the VM should suspend running the program and
+ * just listen for debug commands.
+ */
+ String fSuspendVM;
- /** Flag indicating whether the debugger is performing a step. */
- boolean fStepVM = false;
+ /** Flag indicating whether the debugger is performing a step. */
+ boolean fStepVM = false;
- /** Flag indicating whether the debugger is performing a step return */
- boolean fStepReturnVM = false;
+ /** Flag indicating whether the debugger is performing a step return */
+ boolean fStepReturnVM = false;
- int fSteppingThread = 0;
+ int fSteppingThread = 0;
- /** Name of the pda program being debugged */
- final String fFilename;
+ /** Name of the pda program being debugged */
+ final String fFilename;
- /** The command line argument to start a debug session. */
- final boolean fDebug;
+ /** The command line argument to start a debug session. */
+ final boolean fDebug;
- /** The port to listen for debug commands on */
- final int fCommandPort;
+ /** The port to listen for debug commands on */
+ final int fCommandPort;
- /**
- * Command socket for receiving debug commands and sending command responses
- */
- Socket fCommandSocket;
+ /**
+ * Command socket for receiving debug commands and sending command responses
+ */
+ Socket fCommandSocket;
- /** Command socket reader */
- BufferedReader fCommandReceiveStream;
+ /** Command socket reader */
+ BufferedReader fCommandReceiveStream;
- /** Command socket write stream. */
- OutputStream fCommandResponseStream;
+ /** Command socket write stream. */
+ OutputStream fCommandResponseStream;
- /** The port to send debug events to */
- final int fEventPort;
+ /** The port to send debug events to */
+ final int fEventPort;
- /** Event socket */
- Socket fEventSocket;
+ /** Event socket */
+ Socket fEventSocket;
- /** Event socket and write stream. */
- OutputStream fEventStream;
+ /** Event socket and write stream. */
+ OutputStream fEventStream;
- /** The eventstops table holds which events cause suspends and which do not. */
+ /** The eventstops table holds which events cause suspends and which do not. */
final Map<String, Boolean> fEventStops = new HashMap<>();
- {
- fEventStops.put("unimpinstr", Boolean.FALSE); //$NON-NLS-1$
- fEventStops.put("nosuchlabel", Boolean.FALSE); //$NON-NLS-1$
- }
-
- /**
- * The watchpoints table holds watchpoint information.
- * <p/>
- * variablename_stackframedepth => N
- * <ul>
- * <li>N = 0 is no watch</li>
- * <li>N = 1 is read watch</li>
- * <li>N = 2 is write watch</li>
- * <li>N = 3 is both, etc.</li>
- */
+ {
+ fEventStops.put("unimpinstr", Boolean.FALSE); //$NON-NLS-1$
+ fEventStops.put("nosuchlabel", Boolean.FALSE); //$NON-NLS-1$
+ }
+
+ /**
+ * The watchpoints table holds watchpoint information.
+ * <p/>
+ * variablename_stackframedepth => N
+ * <ul>
+ * <li>N = 0 is no watch</li>
+ * <li>N = 1 is read watch</li>
+ * <li>N = 2 is write watch</li>
+ * <li>N = 3 is both, etc.</li>
+ */
final Map<String, Integer> fWatchpoints = new HashMap<>();
- public static void main(String[] args) {
- String programFile = args.length >= 1 ? args[0] : null;
- if (programFile == null) {
- System.err.println("Error: No program specified"); //$NON-NLS-1$
- return;
- }
-
- String debugFlag = args.length >= 2 ? args[1] : ""; //$NON-NLS-1$
- boolean debug = "-debug".equals(debugFlag); //$NON-NLS-1$
- int commandPort = 0;
- int eventPort = 0;
-
- if (debug) {
- String commandPortStr = args.length >= 3 ? args[2] : ""; //$NON-NLS-1$
- try {
- commandPort = Integer.parseInt(commandPortStr);
- } catch (NumberFormatException e) {
- System.err.println("Error: Invalid command port"); //$NON-NLS-1$
- return;
- }
-
- String eventPortStr = args.length >= 4 ? args[3] : ""; //$NON-NLS-1$
- try {
- eventPort = Integer.parseInt(eventPortStr);
- } catch (NumberFormatException e) {
- System.err.println("Error: Invalid event port"); //$NON-NLS-1$
- return;
- }
- }
-
- PDAVirtualMachine pdaVM = null;
- try {
- pdaVM = new PDAVirtualMachine(programFile, debug, commandPort, eventPort);
- pdaVM.startDebugger();
- } catch (IOException e) {
- System.err.println("Error: " + e.toString()); //$NON-NLS-1$
- return;
- }
- pdaVM.run();
- }
-
- PDAVirtualMachine(String inputFile, boolean debug, int commandPort, int eventPort) throws IOException {
- fFilename = inputFile;
-
- // Load all the code into memory
- StringWriter stringWriter = new StringWriter();
+ public static void main(String[] args) {
+ String programFile = args.length >= 1 ? args[0] : null;
+ if (programFile == null) {
+ System.err.println("Error: No program specified"); //$NON-NLS-1$
+ return;
+ }
+
+ String debugFlag = args.length >= 2 ? args[1] : ""; //$NON-NLS-1$
+ boolean debug = "-debug".equals(debugFlag); //$NON-NLS-1$
+ int commandPort = 0;
+ int eventPort = 0;
+
+ if (debug) {
+ String commandPortStr = args.length >= 3 ? args[2] : ""; //$NON-NLS-1$
+ try {
+ commandPort = Integer.parseInt(commandPortStr);
+ } catch (NumberFormatException e) {
+ System.err.println("Error: Invalid command port"); //$NON-NLS-1$
+ return;
+ }
+
+ String eventPortStr = args.length >= 4 ? args[3] : ""; //$NON-NLS-1$
+ try {
+ eventPort = Integer.parseInt(eventPortStr);
+ } catch (NumberFormatException e) {
+ System.err.println("Error: Invalid event port"); //$NON-NLS-1$
+ return;
+ }
+ }
+
+ PDAVirtualMachine pdaVM = null;
+ try {
+ pdaVM = new PDAVirtualMachine(programFile, debug, commandPort, eventPort);
+ pdaVM.startDebugger();
+ } catch (IOException e) {
+ System.err.println("Error: " + e.toString()); //$NON-NLS-1$
+ return;
+ }
+ pdaVM.run();
+ }
+
+ PDAVirtualMachine(String inputFile, boolean debug, int commandPort, int eventPort) throws IOException {
+ fFilename = inputFile;
+
+ // Load all the code into memory
+ StringWriter stringWriter = new StringWriter();
List<String> code = new LinkedList<>();
try (FileReader fileReader = new FileReader(inputFile)) {
- int c = fileReader.read();
- while (c != -1) {
- if (c == '\n') {
- code.add(stringWriter.toString().trim());
- stringWriter = new StringWriter();
- } else {
- stringWriter.write(c);
- }
- c = fileReader.read();
- }
- }
-
- code.add(stringWriter.toString().trim());
- fCode = code.toArray(new String[code.size()]);
-
- fLabels = mapLabels(fCode);
-
- fDebug = debug;
- fCommandPort = commandPort;
- fEventPort = eventPort;
- }
-
- /**
- * Initializes the labels map
- */
+ int c = fileReader.read();
+ while (c != -1) {
+ if (c == '\n') {
+ code.add(stringWriter.toString().trim());
+ stringWriter = new StringWriter();
+ } else {
+ stringWriter.write(c);
+ }
+ c = fileReader.read();
+ }
+ }
+
+ code.add(stringWriter.toString().trim());
+ fCode = code.toArray(new String[code.size()]);
+
+ fLabels = mapLabels(fCode);
+
+ fDebug = debug;
+ fCommandPort = commandPort;
+ fEventPort = eventPort;
+ }
+
+ /**
+ * Initializes the labels map
+ */
Map<String, Integer> mapLabels(String[] code) {
Map<String, Integer> labels = new HashMap<>();
- for (int i = 0; i < code.length; i++) {
- if (code[i].length() != 0 && code[i].charAt(0) == ':') {
- labels.put(code[i].substring(1), Integer.valueOf(i));
- }
- }
- return labels;
- }
-
- void sendCommandResponse(String response) {
- try {
- fCommandResponseStream.write(response.getBytes());
- fCommandResponseStream.flush();
- } catch (IOException e) {
- }
- }
-
- void sendDebugEvent(String event, boolean error) {
- if (fDebug) {
- try {
- fEventStream.write(event.getBytes());
- fEventStream.write('\n');
- fEventStream.flush();
- } catch (IOException e) {
- System.err.println("Error: " + e); //$NON-NLS-1$
- System.exit(1);
- }
- } else if (error) {
- System.err.println("Error: " + event); //$NON-NLS-1$
- }
- }
-
- void startDebugger() throws IOException {
- if (fDebug) {
- System.out.println("-debug " + fCommandPort + " " + fEventPort); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ for (int i = 0; i < code.length; i++) {
+ if (code[i].length() != 0 && code[i].charAt(0) == ':') {
+ labels.put(code[i].substring(1), Integer.valueOf(i));
+ }
+ }
+ return labels;
+ }
+
+ void sendCommandResponse(String response) {
+ try {
+ fCommandResponseStream.write(response.getBytes());
+ fCommandResponseStream.flush();
+ } catch (IOException e) {
+ }
+ }
+
+ void sendDebugEvent(String event, boolean error) {
+ if (fDebug) {
+ try {
+ fEventStream.write(event.getBytes());
+ fEventStream.write('\n');
+ fEventStream.flush();
+ } catch (IOException e) {
+ System.err.println("Error: " + e); //$NON-NLS-1$
+ System.exit(1);
+ }
+ } else if (error) {
+ System.err.println("Error: " + event); //$NON-NLS-1$
+ }
+ }
+
+ void startDebugger() throws IOException {
+ if (fDebug) {
+ System.out.println("-debug " + fCommandPort + " " + fEventPort); //$NON-NLS-1$ //$NON-NLS-2$
+ }
try (ServerSocket commandServerSocket = new ServerSocket(fCommandPort)) {
fCommandSocket = commandServerSocket.accept();
@@ -463,104 +463,104 @@ public class PDAVirtualMachine {
}
try (ServerSocket eventServerSocket = new ServerSocket(fEventPort)) {
- fEventSocket = eventServerSocket.accept();
- fEventStream = new PrintStream(fEventSocket.getOutputStream());
- }
-
- System.out.println("debug connection accepted"); //$NON-NLS-1$
-
- fSuspendVM = "client"; //$NON-NLS-1$
- }
-
- void run() {
- int id = fNextThreadId++;
- sendDebugEvent("vmstarted", false); //$NON-NLS-1$
- fThreads.put(Integer.valueOf(id), new PDAThread(id, "main", 0)); //$NON-NLS-1$
- if (fDebug) {
- sendDebugEvent("started " + id, false); //$NON-NLS-1$
- }
-
- boolean allThreadsSuspended = false;
- while (!fThreads.isEmpty()) {
- checkForBreakpoint();
-
- if (fSuspendVM != null) {
- debugUI();
- } else {
- yieldToDebug(allThreadsSuspended);
- if (fSuspendVM != null) {
- // Received a command to suspend VM, skip executing threads.
- continue;
- }
- }
-
- PDAThread[] threadsCopy = fThreads.values().toArray(new PDAThread[fThreads.size()]);
- allThreadsSuspended = true;
- for (int i = 0; i < threadsCopy.length; i++) {
- PDAThread thread = threadsCopy[i];
- if (thread.fSuspend == null) {
- allThreadsSuspended = false;
-
- String instruction = thread.fThreadCode[thread.fCurrentFrame.fPC];
- thread.fCurrentFrame.fPC++;
- doOneInstruction(thread, instruction);
- if (thread.fCurrentFrame.fPC >= thread.fThreadCode.length) {
- // Thread reached end of code, exit from the thread.
- thread.fRun = false;
- } else if (thread.fStepReturn) {
- // If this thread is in a step-return operation, check
- // if we've returned from a call.
- instruction = thread.fThreadCode[thread.fCurrentFrame.fPC];
- if ("return".equals(instruction)) { //$NON-NLS-1$
- // Note: this will only be triggered if the current
- // thread also has the fStepReturn flag set.
- if (fStepReturnVM) {
- fSuspendVM = thread.fID + " step"; //$NON-NLS-1$
- } else {
- thread.fSuspend = "step"; //$NON-NLS-1$
- }
- }
- }
- if (!thread.fRun) {
- sendDebugEvent("exited " + thread.fID, false); //$NON-NLS-1$
- fThreads.remove(Integer.valueOf(thread.fID));
- } else if (thread.fSuspend != null) {
- sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false); //$NON-NLS-1$ //$NON-NLS-2$
- thread.fStep = thread.fStepReturn = thread.fPerformingEval = false;
- }
- }
- }
-
- // Force thread context switch to avoid starving out other
- // processes in the system.
- Thread.yield();
- }
-
- sendDebugEvent("vmterminated", false); //$NON-NLS-1$
- if (fDebug) {
- try {
- fCommandReceiveStream.close();
- fCommandResponseStream.close();
- fCommandSocket.close();
- fEventStream.close();
- fEventSocket.close();
- } catch (IOException e) {
- System.out.println("Error: " + e); //$NON-NLS-1$
- }
- }
-
- }
-
- void doOneInstruction(PDAThread thread, String instr) {
- StringTokenizer tokenizer = new StringTokenizer(instr);
- String op = tokenizer.nextToken();
+ fEventSocket = eventServerSocket.accept();
+ fEventStream = new PrintStream(fEventSocket.getOutputStream());
+ }
+
+ System.out.println("debug connection accepted"); //$NON-NLS-1$
+
+ fSuspendVM = "client"; //$NON-NLS-1$
+ }
+
+ void run() {
+ int id = fNextThreadId++;
+ sendDebugEvent("vmstarted", false); //$NON-NLS-1$
+ fThreads.put(Integer.valueOf(id), new PDAThread(id, "main", 0)); //$NON-NLS-1$
+ if (fDebug) {
+ sendDebugEvent("started " + id, false); //$NON-NLS-1$
+ }
+
+ boolean allThreadsSuspended = false;
+ while (!fThreads.isEmpty()) {
+ checkForBreakpoint();
+
+ if (fSuspendVM != null) {
+ debugUI();
+ } else {
+ yieldToDebug(allThreadsSuspended);
+ if (fSuspendVM != null) {
+ // Received a command to suspend VM, skip executing threads.
+ continue;
+ }
+ }
+
+ PDAThread[] threadsCopy = fThreads.values().toArray(new PDAThread[fThreads.size()]);
+ allThreadsSuspended = true;
+ for (int i = 0; i < threadsCopy.length; i++) {
+ PDAThread thread = threadsCopy[i];
+ if (thread.fSuspend == null) {
+ allThreadsSuspended = false;
+
+ String instruction = thread.fThreadCode[thread.fCurrentFrame.fPC];
+ thread.fCurrentFrame.fPC++;
+ doOneInstruction(thread, instruction);
+ if (thread.fCurrentFrame.fPC >= thread.fThreadCode.length) {
+ // Thread reached end of code, exit from the thread.
+ thread.fRun = false;
+ } else if (thread.fStepReturn) {
+ // If this thread is in a step-return operation, check
+ // if we've returned from a call.
+ instruction = thread.fThreadCode[thread.fCurrentFrame.fPC];
+ if ("return".equals(instruction)) { //$NON-NLS-1$
+ // Note: this will only be triggered if the current
+ // thread also has the fStepReturn flag set.
+ if (fStepReturnVM) {
+ fSuspendVM = thread.fID + " step"; //$NON-NLS-1$
+ } else {
+ thread.fSuspend = "step"; //$NON-NLS-1$
+ }
+ }
+ }
+ if (!thread.fRun) {
+ sendDebugEvent("exited " + thread.fID, false); //$NON-NLS-1$
+ fThreads.remove(Integer.valueOf(thread.fID));
+ } else if (thread.fSuspend != null) {
+ sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false); //$NON-NLS-1$ //$NON-NLS-2$
+ thread.fStep = thread.fStepReturn = thread.fPerformingEval = false;
+ }
+ }
+ }
+
+ // Force thread context switch to avoid starving out other
+ // processes in the system.
+ Thread.yield();
+ }
+
+ sendDebugEvent("vmterminated", false); //$NON-NLS-1$
+ if (fDebug) {
+ try {
+ fCommandReceiveStream.close();
+ fCommandResponseStream.close();
+ fCommandSocket.close();
+ fEventStream.close();
+ fEventSocket.close();
+ } catch (IOException e) {
+ System.out.println("Error: " + e); //$NON-NLS-1$
+ }
+ }
+
+ }
+
+ void doOneInstruction(PDAThread thread, String instr) {
+ StringTokenizer tokenizer = new StringTokenizer(instr);
+ String op = tokenizer.nextToken();
List<String> tokens = new LinkedList<>();
- while (tokenizer.hasMoreTokens()) {
- tokens.add(tokenizer.nextToken());
- }
- Args args = new Args( tokens.toArray(new String[tokens.size()]) );
+ while (tokenizer.hasMoreTokens()) {
+ tokens.add(tokenizer.nextToken());
+ }
+ Args args = new Args( tokens.toArray(new String[tokens.size()]) );
- boolean opValid = true;
+ boolean opValid = true;
if (op.equals("add")) { //$NON-NLS-1$
iAdd(thread, args);
} else if (op.equals("branch_not_zero")) { //$NON-NLS-1$
@@ -590,122 +590,122 @@ public class PDAVirtualMachine {
} else if (op.equals("xyzzy")) { //$NON-NLS-1$
iInternalEndEval(thread, args);
} else if (op.startsWith(":")) {} // label //$NON-NLS-1$
- else if (op.startsWith("#")) {} // comment //$NON-NLS-1$
- else {
- opValid = false;
- }
-
- if (!opValid) {
- sendDebugEvent("unimplemented instruction " + op, true); //$NON-NLS-1$
- if ( fEventStops.get("unimpinstr").booleanValue() ) { //$NON-NLS-1$
- fSuspendVM = thread.fID + " event unimpinstr"; //$NON-NLS-1$
- thread.fCurrentFrame.fPC--;
- }
- } else if (thread.fStep) {
- if (fStepVM) {
- fSuspendVM = thread.fID + " step"; //$NON-NLS-1$
- fStepVM = false;
- } else {
- thread.fSuspend = "step"; //$NON-NLS-1$
- }
- thread.fStep = false;
- }
- }
-
- void checkForBreakpoint() {
- if (fDebug) {
+ else if (op.startsWith("#")) {} // comment //$NON-NLS-1$
+ else {
+ opValid = false;
+ }
+
+ if (!opValid) {
+ sendDebugEvent("unimplemented instruction " + op, true); //$NON-NLS-1$
+ if ( fEventStops.get("unimpinstr").booleanValue() ) { //$NON-NLS-1$
+ fSuspendVM = thread.fID + " event unimpinstr"; //$NON-NLS-1$
+ thread.fCurrentFrame.fPC--;
+ }
+ } else if (thread.fStep) {
+ if (fStepVM) {
+ fSuspendVM = thread.fID + " step"; //$NON-NLS-1$
+ fStepVM = false;
+ } else {
+ thread.fSuspend = "step"; //$NON-NLS-1$
+ }
+ thread.fStep = false;
+ }
+ }
+
+ void checkForBreakpoint() {
+ if (fDebug) {
for (Iterator<PDAThread> itr = fThreads.values().iterator(); itr.hasNext();) {
- PDAThread thread = itr.next();
- Integer pc = Integer.valueOf(thread.fCurrentFrame.fPC);
- // Suspend for breakpoint if:
- // - the VM is not yet set to suspend, for e.g. as a result of step end,
- // - the thread is not yet suspended and is not performing an evaluation
- // - the breakpoints table contains a breakpoint for the given line.
- if (fSuspendVM == null &&
- thread.fSuspend == null && !thread.fPerformingEval &&
- fBreakpoints.containsKey(pc))
- {
- if ( fBreakpoints.get(pc).booleanValue() ) {
- fSuspendVM = thread.fID + " breakpoint " + pc; //$NON-NLS-1$
- } else {
- thread.fSuspend = "breakpoint " + pc; //$NON-NLS-1$
- thread.fStep = thread.fStepReturn = false;
- sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- }
- }
- }
-
- /**
- * After each instruction, we check the debug command channel for control input. If
- * there are commands, process them.
- */
- void yieldToDebug(boolean allThreadsSuspended) {
- if (fDebug) {
- String line = ""; //$NON-NLS-1$
- try {
- if (allThreadsSuspended || fCommandReceiveStream.ready()) {
- line = fCommandReceiveStream.readLine();
- processDebugCommand(line);
- }
- } catch (IOException e) {
- System.err.println("Error: " + e); //$NON-NLS-1$
- System.exit(1);
- }
- }
- }
-
- /**
- * Service the debugger commands while the VM is suspended
- */
- void debugUI() {
- if (!fStarted) {
- sendDebugEvent("vmsuspended " + fSuspendVM, false); //$NON-NLS-1$
- } else {
- fStarted = false;
- }
-
- // Clear all stepping flags. In case the VM suspended while
- // a step operation was being performed for the VM or some thread.
- fStepVM = fStepReturnVM = false;
+ PDAThread thread = itr.next();
+ Integer pc = Integer.valueOf(thread.fCurrentFrame.fPC);
+ // Suspend for breakpoint if:
+ // - the VM is not yet set to suspend, for e.g. as a result of step end,
+ // - the thread is not yet suspended and is not performing an evaluation
+ // - the breakpoints table contains a breakpoint for the given line.
+ if (fSuspendVM == null &&
+ thread.fSuspend == null && !thread.fPerformingEval &&
+ fBreakpoints.containsKey(pc))
+ {
+ if ( fBreakpoints.get(pc).booleanValue() ) {
+ fSuspendVM = thread.fID + " breakpoint " + pc; //$NON-NLS-1$
+ } else {
+ thread.fSuspend = "breakpoint " + pc; //$NON-NLS-1$
+ thread.fStep = thread.fStepReturn = false;
+ sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * After each instruction, we check the debug command channel for control input. If
+ * there are commands, process them.
+ */
+ void yieldToDebug(boolean allThreadsSuspended) {
+ if (fDebug) {
+ String line = ""; //$NON-NLS-1$
+ try {
+ if (allThreadsSuspended || fCommandReceiveStream.ready()) {
+ line = fCommandReceiveStream.readLine();
+ processDebugCommand(line);
+ }
+ } catch (IOException e) {
+ System.err.println("Error: " + e); //$NON-NLS-1$
+ System.exit(1);
+ }
+ }
+ }
+
+ /**
+ * Service the debugger commands while the VM is suspended
+ */
+ void debugUI() {
+ if (!fStarted) {
+ sendDebugEvent("vmsuspended " + fSuspendVM, false); //$NON-NLS-1$
+ } else {
+ fStarted = false;
+ }
+
+ // Clear all stepping flags. In case the VM suspended while
+ // a step operation was being performed for the VM or some thread.
+ fStepVM = fStepReturnVM = false;
for (Iterator<PDAThread> itr = fThreads.values().iterator(); itr.hasNext();) {
- PDAThread thread = itr.next();
- thread.fSuspend = null;
- thread.fStep = thread.fStepReturn = thread.fPerformingEval = false;
- }
-
- while (fSuspendVM != null) {
- String line = ""; //$NON-NLS-1$
- try {
- line = fCommandReceiveStream.readLine();
- } catch (IOException e) {
- System.err.println("Error: " + e); //$NON-NLS-1$
- System.exit(1);
- return;
- }
- processDebugCommand(line);
- }
-
- if (fStepVM || fStepReturnVM) {
- sendDebugEvent("vmresumed step", false); //$NON-NLS-1$
- } else {
- sendDebugEvent("vmresumed client", false); //$NON-NLS-1$
- }
- }
-
- void processDebugCommand(String line) {
- StringTokenizer tokenizer = new StringTokenizer(line.trim());
- if (line.length() == 0) {
- return;
- }
-
- String command = tokenizer.nextToken();
+ PDAThread thread = itr.next();
+ thread.fSuspend = null;
+ thread.fStep = thread.fStepReturn = thread.fPerformingEval = false;
+ }
+
+ while (fSuspendVM != null) {
+ String line = ""; //$NON-NLS-1$
+ try {
+ line = fCommandReceiveStream.readLine();
+ } catch (IOException e) {
+ System.err.println("Error: " + e); //$NON-NLS-1$
+ System.exit(1);
+ return;
+ }
+ processDebugCommand(line);
+ }
+
+ if (fStepVM || fStepReturnVM) {
+ sendDebugEvent("vmresumed step", false); //$NON-NLS-1$
+ } else {
+ sendDebugEvent("vmresumed client", false); //$NON-NLS-1$
+ }
+ }
+
+ void processDebugCommand(String line) {
+ StringTokenizer tokenizer = new StringTokenizer(line.trim());
+ if (line.length() == 0) {
+ return;
+ }
+
+ String command = tokenizer.nextToken();
List<String> tokens = new LinkedList<>();
- while (tokenizer.hasMoreTokens()) {
- tokens.add(tokenizer.nextToken());
- }
- Args args = new Args( tokens.toArray(new String[tokens.size()]));
+ while (tokenizer.hasMoreTokens()) {
+ tokens.add(tokenizer.nextToken());
+ }
+ Args args = new Args( tokens.toArray(new String[tokens.size()]));
if ("children".equals(command)) { //$NON-NLS-1$
debugChildren(args);
@@ -764,770 +764,770 @@ public class PDAVirtualMachine {
} else if ("watch".equals(command)) { //$NON-NLS-1$
debugWatch(args);
} else {
- sendCommandResponse("error: invalid command\n"); //$NON-NLS-1$
- }
- }
+ sendCommandResponse("error: invalid command\n"); //$NON-NLS-1$
+ }
+ }
- void debugChildren(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
+ void debugChildren(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
- int sfnumber = args.getNextIntArg();
- String var = args.getNextStringArg();
+ int sfnumber = args.getNextIntArg();
+ String var = args.getNextStringArg();
- Frame frame = sfnumber >= thread.fFrames.size()
- ? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber);
+ Frame frame = sfnumber >= thread.fFrames.size()
+ ? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber);
- String varDot = var + "."; //$NON-NLS-1$
+ String varDot = var + "."; //$NON-NLS-1$
List<String> children = new ArrayList<>();
for (Iterator<String> itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) {
- String localVar = itr.next();
- if (localVar.startsWith(varDot) && localVar.indexOf('.', varDot.length() + 1) == -1) {
- children.add(localVar);
- }
- }
+ String localVar = itr.next();
+ if (localVar.startsWith(varDot) && localVar.indexOf('.', varDot.length() + 1) == -1) {
+ children.add(localVar);
+ }
+ }
- StringBuilder result = new StringBuilder();
+ StringBuilder result = new StringBuilder();
for (Iterator<String> itr = children.iterator(); itr.hasNext();) {
- result.append(itr.next());
- result.append('|');
- }
- result.append('\n');
+ result.append(itr.next());
+ result.append('|');
+ }
+ result.append('\n');
- sendCommandResponse(result.toString());
- }
+ sendCommandResponse(result.toString());
+ }
- void debugClearBreakpoint(Args args) {
- int line = args.getNextIntArg();
+ void debugClearBreakpoint(Args args) {
+ int line = args.getNextIntArg();
- fBreakpoints.remove( Integer.valueOf(line) );
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
+ fBreakpoints.remove( Integer.valueOf(line) );
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
- private static Pattern fPackPattern = Pattern.compile("%([a-fA-F0-9][a-fA-F0-9])"); //$NON-NLS-1$
+ private static Pattern fPackPattern = Pattern.compile("%([a-fA-F0-9][a-fA-F0-9])"); //$NON-NLS-1$
- void debugData(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
+ void debugData(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
- StringBuilder result = new StringBuilder();
+ StringBuilder result = new StringBuilder();
for (Iterator<?> itr = thread.fStack.iterator(); itr.hasNext();) {
- result.append(itr.next());
- result.append('|');
- }
- result.append('\n');
- sendCommandResponse(result.toString());
- }
-
- void debugDropFrame(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- if (!thread.fFrames.isEmpty()) {
- thread.fCurrentFrame = thread.fFrames.remove(thread.fFrames.size() - 1);
- }
- thread.fCurrentFrame.fPC--;
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- if (fSuspendVM != null) {
- sendDebugEvent("vmresumed drop", false); //$NON-NLS-1$
- sendDebugEvent("vmsuspended " + thread.fID + " drop", false); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- sendDebugEvent("resumed " + thread.fID + " drop", false); //$NON-NLS-1$ //$NON-NLS-2$
- sendDebugEvent("suspended " + thread.fID + " drop", false); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- void debugEval(Args args) {
- if (fSuspendVM != null) {
- sendCommandResponse("error: cannot evaluate while vm is suspended\n"); //$NON-NLS-1$
- return;
- }
-
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- if (thread.fSuspend == null) {
- sendCommandResponse("error: thread running\n"); //$NON-NLS-1$
- return;
- }
-
- StringTokenizer tokenizer = new StringTokenizer(args.getNextStringArg(), "|"); //$NON-NLS-1$
- tokenizer.countTokens();
-
- int numEvalLines = tokenizer.countTokens();
- thread.fThreadCode = new String[fCode.length + numEvalLines + 1];
- System.arraycopy(fCode, 0, thread.fThreadCode, 0, fCode.length);
- for (int i = 0; i < numEvalLines; i++) {
- String line = tokenizer.nextToken();
- StringBuilder lineBuf = new StringBuilder(line.length());
- Matcher matcher = fPackPattern.matcher(line);
- int lastMatchEnd = 0;
- while (matcher.find()) {
- lineBuf.append(line.substring(lastMatchEnd, matcher.start()));
- String charCode = line.substring(matcher.start() + 1, matcher.start() + 3);
- try {
- lineBuf.append((char) Integer.parseInt(charCode, 16));
- } catch (NumberFormatException e) {
- }
- lastMatchEnd = matcher.end();
- }
- if (lastMatchEnd < line.length()) {
- lineBuf.append(line.substring(lastMatchEnd));
- }
- thread.fThreadCode[fCode.length + i] = lineBuf.toString();
- }
- thread.fThreadCode[fCode.length + numEvalLines] = "xyzzy"; //$NON-NLS-1$
- thread.fThreadLabels = mapLabels(fCode);
-
- thread.fSavedPC = thread.fCurrentFrame.fPC;
- thread.fCurrentFrame.fPC = fCode.length;
- thread.fPerformingEval = true;
-
- thread.fSuspend = null;
-
- sendCommandResponse("ok\n"); //$NON-NLS-1$
-
- sendDebugEvent("resumed " + thread.fID + " eval", false); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- void debugEventStop(Args args) {
- String event = args.getNextStringArg();
- int stop = args.getNextIntArg();
- fEventStops.put(event, Boolean.valueOf(stop > 0));
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugTerminate() {
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- sendDebugEvent("vmterminated", false); //$NON-NLS-1$
- System.exit(0);
- }
-
- void debugFrame(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- int sfnumber = args.getNextIntArg();
- Frame frame = null;
- if (sfnumber >= thread.fFrames.size()) {
- frame = thread.fCurrentFrame;
- } else {
- frame = thread.fFrames.get(sfnumber);
- }
- sendCommandResponse(printFrame(frame) + "\n"); //$NON-NLS-1$
- }
-
- /**
- * @param args
- */
- void debugGroups(Args args) {
+ result.append(itr.next());
+ result.append('|');
+ }
+ result.append('\n');
+ sendCommandResponse(result.toString());
+ }
+
+ void debugDropFrame(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ if (!thread.fFrames.isEmpty()) {
+ thread.fCurrentFrame = thread.fFrames.remove(thread.fFrames.size() - 1);
+ }
+ thread.fCurrentFrame.fPC--;
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ if (fSuspendVM != null) {
+ sendDebugEvent("vmresumed drop", false); //$NON-NLS-1$
+ sendDebugEvent("vmsuspended " + thread.fID + " drop", false); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ sendDebugEvent("resumed " + thread.fID + " drop", false); //$NON-NLS-1$ //$NON-NLS-2$
+ sendDebugEvent("suspended " + thread.fID + " drop", false); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ void debugEval(Args args) {
+ if (fSuspendVM != null) {
+ sendCommandResponse("error: cannot evaluate while vm is suspended\n"); //$NON-NLS-1$
+ return;
+ }
+
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ if (thread.fSuspend == null) {
+ sendCommandResponse("error: thread running\n"); //$NON-NLS-1$
+ return;
+ }
+
+ StringTokenizer tokenizer = new StringTokenizer(args.getNextStringArg(), "|"); //$NON-NLS-1$
+ tokenizer.countTokens();
+
+ int numEvalLines = tokenizer.countTokens();
+ thread.fThreadCode = new String[fCode.length + numEvalLines + 1];
+ System.arraycopy(fCode, 0, thread.fThreadCode, 0, fCode.length);
+ for (int i = 0; i < numEvalLines; i++) {
+ String line = tokenizer.nextToken();
+ StringBuilder lineBuf = new StringBuilder(line.length());
+ Matcher matcher = fPackPattern.matcher(line);
+ int lastMatchEnd = 0;
+ while (matcher.find()) {
+ lineBuf.append(line.substring(lastMatchEnd, matcher.start()));
+ String charCode = line.substring(matcher.start() + 1, matcher.start() + 3);
+ try {
+ lineBuf.append((char) Integer.parseInt(charCode, 16));
+ } catch (NumberFormatException e) {
+ }
+ lastMatchEnd = matcher.end();
+ }
+ if (lastMatchEnd < line.length()) {
+ lineBuf.append(line.substring(lastMatchEnd));
+ }
+ thread.fThreadCode[fCode.length + i] = lineBuf.toString();
+ }
+ thread.fThreadCode[fCode.length + numEvalLines] = "xyzzy"; //$NON-NLS-1$
+ thread.fThreadLabels = mapLabels(fCode);
+
+ thread.fSavedPC = thread.fCurrentFrame.fPC;
+ thread.fCurrentFrame.fPC = fCode.length;
+ thread.fPerformingEval = true;
+
+ thread.fSuspend = null;
+
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+
+ sendDebugEvent("resumed " + thread.fID + " eval", false); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ void debugEventStop(Args args) {
+ String event = args.getNextStringArg();
+ int stop = args.getNextIntArg();
+ fEventStops.put(event, Boolean.valueOf(stop > 0));
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugTerminate() {
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ sendDebugEvent("vmterminated", false); //$NON-NLS-1$
+ System.exit(0);
+ }
+
+ void debugFrame(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ int sfnumber = args.getNextIntArg();
+ Frame frame = null;
+ if (sfnumber >= thread.fFrames.size()) {
+ frame = thread.fCurrentFrame;
+ } else {
+ frame = thread.fFrames.get(sfnumber);
+ }
+ sendCommandResponse(printFrame(frame) + "\n"); //$NON-NLS-1$
+ }
+
+ /**
+ * @param args
+ */
+ void debugGroups(Args args) {
TreeSet<String> groups = new TreeSet<>();
for (Iterator<Register> itr = fRegisters.values().iterator(); itr.hasNext();) {
- Register reg = itr.next();
- groups.add(reg.fGroup);
- }
- StringBuilder response = new StringBuilder();
+ Register reg = itr.next();
+ groups.add(reg.fGroup);
+ }
+ StringBuilder response = new StringBuilder();
for (Iterator<String> itr = groups.iterator(); itr.hasNext();) {
- response.append(itr.next());
- response.append('|');
- }
- response.append('\n');
- sendCommandResponse(response.toString());
- }
-
- void debugPopData(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- thread.fStack.pop();
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugPushData(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- Object val = args.getNextIntOrStringArg();
- thread.fStack.push(val);
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugRegisters(Args args) {
- String group = args.getNextStringArg();
-
- StringBuilder response = new StringBuilder();
+ response.append(itr.next());
+ response.append('|');
+ }
+ response.append('\n');
+ sendCommandResponse(response.toString());
+ }
+
+ void debugPopData(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ thread.fStack.pop();
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugPushData(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ Object val = args.getNextIntOrStringArg();
+ thread.fStack.push(val);
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugRegisters(Args args) {
+ String group = args.getNextStringArg();
+
+ StringBuilder response = new StringBuilder();
for (Iterator<Register> itr = fRegisters.values().iterator(); itr.hasNext();) {
- Register reg = itr.next();
- if (group.equals(reg.fGroup)) {
- response.append(reg.fName);
- response.append(' ');
- response.append(reg.fIsWriteable);
+ Register reg = itr.next();
+ if (group.equals(reg.fGroup)) {
+ response.append(reg.fName);
+ response.append(' ');
+ response.append(reg.fIsWriteable);
for (Iterator<BitField> itr2 = reg.fBitFields.values().iterator(); itr2.hasNext();) {
- BitField bitField = itr2.next();
- response.append('|');
- response.append(bitField.fName);
- response.append(' ');
- response.append(bitField.fBitOffset);
- response.append(' ');
- response.append(bitField.fBitCount);
- response.append(' ');
+ BitField bitField = itr2.next();
+ response.append('|');
+ response.append(bitField.fName);
+ response.append(' ');
+ response.append(bitField.fBitOffset);
+ response.append(' ');
+ response.append(bitField.fBitCount);
+ response.append(' ');
for (Iterator<Entry<String, Integer>> itr3 = bitField.fMnemonics.entrySet().iterator(); itr3.hasNext();) {
Entry<String, Integer> mnemonicEntry = itr3.next();
- response.append(mnemonicEntry.getKey());
- response.append(' ');
- response.append(mnemonicEntry.getValue());
- response.append(' ');
- }
- }
-
- response.append('#');
- }
- }
- response.append('\n');
- sendCommandResponse(response.toString());
- }
-
- /**
- * @param args
- */
- void debugRestart(Args args) {
- fSuspendVM = "restart"; //$NON-NLS-1$
+ response.append(mnemonicEntry.getKey());
+ response.append(' ');
+ response.append(mnemonicEntry.getValue());
+ response.append(' ');
+ }
+ }
+
+ response.append('#');
+ }
+ }
+ response.append('\n');
+ sendCommandResponse(response.toString());
+ }
+
+ /**
+ * @param args
+ */
+ void debugRestart(Args args) {
+ fSuspendVM = "restart"; //$NON-NLS-1$
for (Iterator<Integer> itr = fThreads.keySet().iterator(); itr.hasNext();) {
- Integer id = itr.next();
- sendDebugEvent("exited " + id, false); //$NON-NLS-1$
- }
- fThreads.clear();
-
- int id = fNextThreadId++;
- fThreads.put(Integer.valueOf(id), new PDAThread(id, "main", 0)); //$NON-NLS-1$
- sendDebugEvent("started " + id, false); //$NON-NLS-1$
-
- fRegisters.clear();
-
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugResume(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
- if (fSuspendVM != null) {
- sendCommandResponse("error: cannot resume thread when vm is suspended\n"); //$NON-NLS-1$
- return;
- }
- if (thread.fSuspend == null) {
- sendCommandResponse("error: thread already running\n"); //$NON-NLS-1$
- return;
- }
-
- thread.fSuspend = null;
- sendDebugEvent("resumed " + thread.fID + " client", false); //$NON-NLS-1$ //$NON-NLS-2$
-
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugSetBreakpoint(Args args) {
- int line = args.getNextIntArg();
- int stopVM = args.getNextIntArg();
-
- fBreakpoints.put(Integer.valueOf(line), Boolean.valueOf(stopVM != 0));
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugSetData(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- int offset = args.getNextIntArg();
- Object val = args.getNextIntOrStringArg();
-
- if (offset < thread.fStack.size()) {
- thread.fStack.set(offset, val);
- } else {
- thread.fStack.add(0, val);
- }
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugSetVariable(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- int sfnumber = args.getNextIntArg();
- String var = args.getNextStringArg();
- Object val = args.getNextIntOrStringArg();
- while (args.hasNextArg()) {
- val = val.toString() + " " + args.getNextStringArg(); //$NON-NLS-1$
- }
-
- if (sfnumber >= thread.fFrames.size()) {
- thread.fCurrentFrame.set(var, val);
- } else {
- thread.fFrames.get(sfnumber).set(var, val);
- }
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugStack(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- StringBuilder result = new StringBuilder();
+ Integer id = itr.next();
+ sendDebugEvent("exited " + id, false); //$NON-NLS-1$
+ }
+ fThreads.clear();
+
+ int id = fNextThreadId++;
+ fThreads.put(Integer.valueOf(id), new PDAThread(id, "main", 0)); //$NON-NLS-1$
+ sendDebugEvent("started " + id, false); //$NON-NLS-1$
+
+ fRegisters.clear();
+
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugResume(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+ if (fSuspendVM != null) {
+ sendCommandResponse("error: cannot resume thread when vm is suspended\n"); //$NON-NLS-1$
+ return;
+ }
+ if (thread.fSuspend == null) {
+ sendCommandResponse("error: thread already running\n"); //$NON-NLS-1$
+ return;
+ }
+
+ thread.fSuspend = null;
+ sendDebugEvent("resumed " + thread.fID + " client", false); //$NON-NLS-1$ //$NON-NLS-2$
+
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugSetBreakpoint(Args args) {
+ int line = args.getNextIntArg();
+ int stopVM = args.getNextIntArg();
+
+ fBreakpoints.put(Integer.valueOf(line), Boolean.valueOf(stopVM != 0));
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugSetData(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ int offset = args.getNextIntArg();
+ Object val = args.getNextIntOrStringArg();
+
+ if (offset < thread.fStack.size()) {
+ thread.fStack.set(offset, val);
+ } else {
+ thread.fStack.add(0, val);
+ }
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugSetVariable(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ int sfnumber = args.getNextIntArg();
+ String var = args.getNextStringArg();
+ Object val = args.getNextIntOrStringArg();
+ while (args.hasNextArg()) {
+ val = val.toString() + " " + args.getNextStringArg(); //$NON-NLS-1$
+ }
+
+ if (sfnumber >= thread.fFrames.size()) {
+ thread.fCurrentFrame.set(var, val);
+ } else {
+ thread.fFrames.get(sfnumber).set(var, val);
+ }
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugStack(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ StringBuilder result = new StringBuilder();
for (Iterator<Frame> itr = thread.fFrames.iterator(); itr.hasNext();) {
- Frame frame = itr.next();
- result.append(printFrame(frame));
- result.append('#');
- }
- result.append(printFrame(thread.fCurrentFrame));
- result.append('\n');
- sendCommandResponse(result.toString());
- }
-
- void debugStackDepth(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
- sendCommandResponse( Integer.toString(thread.fFrames.size() + 1) + "\n" ); //$NON-NLS-1$
- }
-
-
- /**
- * The stack frame output is: frame # frame # frame ... where each frame is:
- * filename | line number | function name | var | var | var | var ...
- */
- private String printFrame(Frame frame) {
- StringBuilder buf = new StringBuilder();
- buf.append(fFilename);
- buf.append('|');
- buf.append(frame.fPC);
- buf.append('|');
- buf.append(frame.fFunction);
+ Frame frame = itr.next();
+ result.append(printFrame(frame));
+ result.append('#');
+ }
+ result.append(printFrame(thread.fCurrentFrame));
+ result.append('\n');
+ sendCommandResponse(result.toString());
+ }
+
+ void debugStackDepth(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+ sendCommandResponse( Integer.toString(thread.fFrames.size() + 1) + "\n" ); //$NON-NLS-1$
+ }
+
+
+ /**
+ * The stack frame output is: frame # frame # frame ... where each frame is:
+ * filename | line number | function name | var | var | var | var ...
+ */
+ private String printFrame(Frame frame) {
+ StringBuilder buf = new StringBuilder();
+ buf.append(fFilename);
+ buf.append('|');
+ buf.append(frame.fPC);
+ buf.append('|');
+ buf.append(frame.fFunction);
for (Iterator<String> itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) {
- String var = itr.next();
- if (var.indexOf('.') == -1) {
- buf.append('|');
- buf.append(var);
- }
- }
- return buf.toString();
- }
-
- void debugState(Args args) {
- PDAThread thread = args.getThreadArg();
- String response = null;
- if (thread == null) {
- response = fSuspendVM == null ? "running" : fSuspendVM; //$NON-NLS-1$
- } else if (fSuspendVM != null) {
- response = "vm"; //$NON-NLS-1$
- } else {
- response = thread.fSuspend == null ? "running" : thread.fSuspend; //$NON-NLS-1$
- }
- sendCommandResponse(response + "\n"); //$NON-NLS-1$
- }
-
- void debugStep(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- // Set suspend to null to allow the debug loop to exit back to the
- // instruction loop and thus run an instruction. However, we want to
- // come back to the debug loop right away, so the step flag is set to
- // true which will cause the suspend flag to get set to true when we
- // get to the next instruction.
- if (fSuspendVM != null) {
- // All threads are suspended, so suspend all threads again when
- // step completes.
- fSuspendVM = null;
- fStepVM = true;
- // Also mark the thread that initiated the step to mark it as
- // the triggering thread when suspending.
- thread.fStep = true;
- } else {
- if (thread.fSuspend == null) {
- sendCommandResponse("error: thread already running\n"); //$NON-NLS-1$
- return;
- }
- thread.fSuspend = null;
- thread.fStep = true;
- sendDebugEvent("resumed " + thread.fID + " step", false); //$NON-NLS-1$ //$NON-NLS-2$
- }
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugStepReturn(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- if (fSuspendVM != null) {
- fSuspendVM = null;
- fStepReturnVM = true;
- thread.fStepReturn = true;
- } else {
- if (thread.fSuspend == null) {
- sendCommandResponse("error: thread running\n"); //$NON-NLS-1$
- return;
- }
- thread.fSuspend = null;
- thread.fStepReturn = true;
- sendDebugEvent("resumed " + thread.fID + " step", false); //$NON-NLS-1$ //$NON-NLS-2$
- }
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugSuspend(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
- if (fSuspendVM != null) {
- sendCommandResponse("error: vm already suspended\n"); //$NON-NLS-1$
- return;
- }
- if (thread.fSuspend != null) {
- sendCommandResponse("error: thread already suspended\n"); //$NON-NLS-1$
- return;
- }
-
- thread.fSuspend = "client"; //$NON-NLS-1$
- sendDebugEvent("suspended " + thread.fID + " client", false); //$NON-NLS-1$ //$NON-NLS-2$
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugThreads() {
- StringBuilder response = new StringBuilder();
+ String var = itr.next();
+ if (var.indexOf('.') == -1) {
+ buf.append('|');
+ buf.append(var);
+ }
+ }
+ return buf.toString();
+ }
+
+ void debugState(Args args) {
+ PDAThread thread = args.getThreadArg();
+ String response = null;
+ if (thread == null) {
+ response = fSuspendVM == null ? "running" : fSuspendVM; //$NON-NLS-1$
+ } else if (fSuspendVM != null) {
+ response = "vm"; //$NON-NLS-1$
+ } else {
+ response = thread.fSuspend == null ? "running" : thread.fSuspend; //$NON-NLS-1$
+ }
+ sendCommandResponse(response + "\n"); //$NON-NLS-1$
+ }
+
+ void debugStep(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ // Set suspend to null to allow the debug loop to exit back to the
+ // instruction loop and thus run an instruction. However, we want to
+ // come back to the debug loop right away, so the step flag is set to
+ // true which will cause the suspend flag to get set to true when we
+ // get to the next instruction.
+ if (fSuspendVM != null) {
+ // All threads are suspended, so suspend all threads again when
+ // step completes.
+ fSuspendVM = null;
+ fStepVM = true;
+ // Also mark the thread that initiated the step to mark it as
+ // the triggering thread when suspending.
+ thread.fStep = true;
+ } else {
+ if (thread.fSuspend == null) {
+ sendCommandResponse("error: thread already running\n"); //$NON-NLS-1$
+ return;
+ }
+ thread.fSuspend = null;
+ thread.fStep = true;
+ sendDebugEvent("resumed " + thread.fID + " step", false); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugStepReturn(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ if (fSuspendVM != null) {
+ fSuspendVM = null;
+ fStepReturnVM = true;
+ thread.fStepReturn = true;
+ } else {
+ if (thread.fSuspend == null) {
+ sendCommandResponse("error: thread running\n"); //$NON-NLS-1$
+ return;
+ }
+ thread.fSuspend = null;
+ thread.fStepReturn = true;
+ sendDebugEvent("resumed " + thread.fID + " step", false); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugSuspend(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+ if (fSuspendVM != null) {
+ sendCommandResponse("error: vm already suspended\n"); //$NON-NLS-1$
+ return;
+ }
+ if (thread.fSuspend != null) {
+ sendCommandResponse("error: thread already suspended\n"); //$NON-NLS-1$
+ return;
+ }
+
+ thread.fSuspend = "client"; //$NON-NLS-1$
+ sendDebugEvent("suspended " + thread.fID + " client", false); //$NON-NLS-1$ //$NON-NLS-2$
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugThreads() {
+ StringBuilder response = new StringBuilder();
for (Iterator<Integer> itr = fThreads.keySet().iterator(); itr.hasNext();) {
- response.append(itr.next());
- response.append(' ');
- }
- sendCommandResponse(response.toString().trim() + "\n"); //$NON-NLS-1$
- }
-
- void debugVar(Args args) {
- PDAThread thread = args.getThreadArg();
- if (thread == null) {
- sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
- return;
- }
-
- int sfnumber = args.getNextIntArg();
- String var = args.getNextStringArg();
-
- Frame frame = sfnumber >= thread.fFrames.size()
- ? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber);
-
- Object val = frame.get(var);
- if (val == null) {
- sendCommandResponse("error: variable undefined\n"); //$NON-NLS-1$
- } else {
- sendCommandResponse(val.toString() + "\n"); //$NON-NLS-1$
- }
- }
-
- void debugVMResume() {
- if (fSuspendVM == null) {
- sendCommandResponse("error: vm already running\n"); //$NON-NLS-1$
- return;
- }
-
- fSuspendVM = null;
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugVMSuspend() {
- if (fSuspendVM != null) {
- sendCommandResponse("error: vm already suspended\n"); //$NON-NLS-1$
- return;
- }
-
- fSuspendVM = "client"; //$NON-NLS-1$
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- void debugWatch(Args args) {
- String funcAndVar = args.getNextStringArg();
- int flags = args.getNextIntArg();
- fWatchpoints.put(funcAndVar, Integer.valueOf(flags));
- sendCommandResponse("ok\n"); //$NON-NLS-1$
- }
-
- /**
- * @param thread
- * @param args
- */
- void iAdd(PDAThread thread, Args args) {
- Object val1 = thread.fStack.pop();
- Object val2 = thread.fStack.pop();
- if (val1 instanceof Integer && val2 instanceof Integer) {
- int intVal1 = ((Integer) val1).intValue();
- int intVal2 = ((Integer) val2).intValue();
- thread.fStack.push( Integer.valueOf(intVal1 + intVal2) );
- } else {
- thread.fStack.push( Integer.valueOf(-1) );
- }
- }
-
- void iBranchNotZero(PDAThread thread, Args args) {
- Object val = thread.fStack.pop();
- if (val instanceof Integer && ((Integer) val).intValue() != 0) {
- String label = args.getNextStringArg();
- if (thread.fThreadLabels.containsKey(label)) {
- thread.fCurrentFrame.fPC = thread.fThreadLabels.get(label).intValue();
- } else {
- sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
- if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
- fSuspendVM = thread.fID + " event nosuchlabel"; //$NON-NLS-1$
- thread.fStack.push(val);
- thread.fCurrentFrame.fPC--;
- }
- }
- }
- }
-
- void iCall(PDAThread thread, Args args) {
- String label = args.getNextStringArg();
- if (thread.fThreadLabels.containsKey(label)) {
- thread.fFrames.add(thread.fCurrentFrame);
- thread.fCurrentFrame = new Frame(label, thread.fThreadLabels.get(label).intValue());
- } else {
- sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
- if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
- fSuspendVM = thread.fID + " event nosuchlabel"; //$NON-NLS-1$
- thread.fCurrentFrame.fPC--;
- }
- }
- }
-
- /**
- * @param thread
- * @param args
- */
- void iDec(PDAThread thread, Args args) {
- Object val = thread.fStack.pop();
- if (val instanceof Integer) {
- val = Integer.valueOf(((Integer) val).intValue() - 1);
- }
- thread.fStack.push(val);
- }
-
- /**
- * @param thread
- * @param args
- */
- void iDef(PDAThread thread, Args args) {
- String type = args.getNextStringArg();
-
- String name = args.getNextStringArg();
- String regName = getRegisterPartOfName(name);
- String bitFieldName = getBitFieldPartOfName(name);
-
- if ("register".equals(type)) { //$NON-NLS-1$
- Register reg = new Register(regName);
- reg.fGroup = args.getNextStringArg();
- fRegisters.put(regName, reg);
- reg.fIsWriteable = args.getNextBooleanArg();
- } else if ("bitfield".equals(type)) { //$NON-NLS-1$
- Register reg = fRegisters.get(regName);
- if (reg == null) {
+ response.append(itr.next());
+ response.append(' ');
+ }
+ sendCommandResponse(response.toString().trim() + "\n"); //$NON-NLS-1$
+ }
+
+ void debugVar(Args args) {
+ PDAThread thread = args.getThreadArg();
+ if (thread == null) {
+ sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
+ return;
+ }
+
+ int sfnumber = args.getNextIntArg();
+ String var = args.getNextStringArg();
+
+ Frame frame = sfnumber >= thread.fFrames.size()
+ ? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber);
+
+ Object val = frame.get(var);
+ if (val == null) {
+ sendCommandResponse("error: variable undefined\n"); //$NON-NLS-1$
+ } else {
+ sendCommandResponse(val.toString() + "\n"); //$NON-NLS-1$
+ }
+ }
+
+ void debugVMResume() {
+ if (fSuspendVM == null) {
+ sendCommandResponse("error: vm already running\n"); //$NON-NLS-1$
+ return;
+ }
+
+ fSuspendVM = null;
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugVMSuspend() {
+ if (fSuspendVM != null) {
+ sendCommandResponse("error: vm already suspended\n"); //$NON-NLS-1$
+ return;
+ }
+
+ fSuspendVM = "client"; //$NON-NLS-1$
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ void debugWatch(Args args) {
+ String funcAndVar = args.getNextStringArg();
+ int flags = args.getNextIntArg();
+ fWatchpoints.put(funcAndVar, Integer.valueOf(flags));
+ sendCommandResponse("ok\n"); //$NON-NLS-1$
+ }
+
+ /**
+ * @param thread
+ * @param args
+ */
+ void iAdd(PDAThread thread, Args args) {
+ Object val1 = thread.fStack.pop();
+ Object val2 = thread.fStack.pop();
+ if (val1 instanceof Integer && val2 instanceof Integer) {
+ int intVal1 = ((Integer) val1).intValue();
+ int intVal2 = ((Integer) val2).intValue();
+ thread.fStack.push( Integer.valueOf(intVal1 + intVal2) );
+ } else {
+ thread.fStack.push( Integer.valueOf(-1) );
+ }
+ }
+
+ void iBranchNotZero(PDAThread thread, Args args) {
+ Object val = thread.fStack.pop();
+ if (val instanceof Integer && ((Integer) val).intValue() != 0) {
+ String label = args.getNextStringArg();
+ if (thread.fThreadLabels.containsKey(label)) {
+ thread.fCurrentFrame.fPC = thread.fThreadLabels.get(label).intValue();
+ } else {
+ sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
+ if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
+ fSuspendVM = thread.fID + " event nosuchlabel"; //$NON-NLS-1$
+ thread.fStack.push(val);
+ thread.fCurrentFrame.fPC--;
+ }
+ }
+ }
+ }
+
+ void iCall(PDAThread thread, Args args) {
+ String label = args.getNextStringArg();
+ if (thread.fThreadLabels.containsKey(label)) {
+ thread.fFrames.add(thread.fCurrentFrame);
+ thread.fCurrentFrame = new Frame(label, thread.fThreadLabels.get(label).intValue());
+ } else {
+ sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
+ if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
+ fSuspendVM = thread.fID + " event nosuchlabel"; //$NON-NLS-1$
+ thread.fCurrentFrame.fPC--;
+ }
+ }
+ }
+
+ /**
+ * @param thread
+ * @param args
+ */
+ void iDec(PDAThread thread, Args args) {
+ Object val = thread.fStack.pop();
+ if (val instanceof Integer) {
+ val = Integer.valueOf(((Integer) val).intValue() - 1);
+ }
+ thread.fStack.push(val);
+ }
+
+ /**
+ * @param thread
+ * @param args
+ */
+ void iDef(PDAThread thread, Args args) {
+ String type = args.getNextStringArg();
+
+ String name = args.getNextStringArg();
+ String regName = getRegisterPartOfName(name);
+ String bitFieldName = getBitFieldPartOfName(name);
+
+ if ("register".equals(type)) { //$NON-NLS-1$
+ Register reg = new Register(regName);
+ reg.fGroup = args.getNextStringArg();
+ fRegisters.put(regName, reg);
+ reg.fIsWriteable = args.getNextBooleanArg();
+ } else if ("bitfield".equals(type)) { //$NON-NLS-1$
+ Register reg = fRegisters.get(regName);
+ if (reg == null) {
return;
}
- BitField bitField = new BitField(bitFieldName);
- bitField.fBitOffset = args.getNextIntArg();
- bitField.fBitCount = args.getNextIntArg();
- reg.fBitFields.put(bitFieldName, bitField);
- } else if ("mnemonic".equals(type)) { //$NON-NLS-1$
- Register reg = fRegisters.get(regName);
- if (reg == null) {
+ BitField bitField = new BitField(bitFieldName);
+ bitField.fBitOffset = args.getNextIntArg();
+ bitField.fBitCount = args.getNextIntArg();
+ reg.fBitFields.put(bitFieldName, bitField);
+ } else if ("mnemonic".equals(type)) { //$NON-NLS-1$
+ Register reg = fRegisters.get(regName);
+ if (reg == null) {
return;
}
- BitField bitField = reg.fBitFields.get(bitFieldName);
- if (bitField == null) {
+ BitField bitField = reg.fBitFields.get(bitFieldName);
+ if (bitField == null) {
return;
}
- bitField.fMnemonics.put(args.getNextStringArg(), Integer.valueOf(args.getNextIntArg()));
- }
- sendDebugEvent("registers", false); //$NON-NLS-1$
- }
-
- private String getRegisterPartOfName(String name) {
- if (name.startsWith("$")) { //$NON-NLS-1$
- int end = name.indexOf('.');
- end = end != -1 ? end : name.length();
- return name.substring(1, end);
- }
- return null;
- }
-
- private String getBitFieldPartOfName(String name) {
- int start = name.indexOf('.');
- if (name.startsWith("$") && start != -1) { //$NON-NLS-1$
- return name.substring(start + 1, name.length());
- }
- return null;
- }
-
- /**
- * @param thread
- * @param args
- */
- void iDup(PDAThread thread, Args args) {
- Object val = thread.fStack.pop();
- thread.fStack.push(val);
- thread.fStack.push(val);
- }
-
- void iExec(PDAThread thread, Args args) {
- String label = args.getNextStringArg();
- if (fLabels.containsKey(label)) {
- int id = fNextThreadId++;
- fThreads.put( Integer.valueOf(id), new PDAThread(id, label, fLabels.get(label).intValue()) );
- sendDebugEvent("started " + id, false); //$NON-NLS-1$
- } else {
- sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
- if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
- thread.fSuspend = "event nosuchlabel"; //$NON-NLS-1$
- thread.fCurrentFrame.fPC--;
- }
- }
- }
-
- /**
- * @param thread
- * @param args
- */
- void iHalt(PDAThread thread, Args args) {
- thread.fRun = false;
- }
-
- /**
- * @param thread
- * @param args
- */
- void iOutput(PDAThread thread, Args args) {
- System.out.println(thread.fStack.pop());
- }
-
- void iPop(PDAThread thread, Args args) {
- String arg = args.getNextStringArg();
- if (arg.startsWith("$")) { //$NON-NLS-1$
- String var = arg.substring(1);
- thread.fCurrentFrame.set(var, thread.fStack.pop());
- String key = thread.fCurrentFrame.fFunction + "::" + var; //$NON-NLS-1$
- if ( fWatchpoints.containsKey(key) && (fWatchpoints.get(key).intValue() & 2) != 0 ) {
- fSuspendVM = thread.fID + " watch write " + key; //$NON-NLS-1$
- }
- } else {
- thread.fStack.pop();
- }
- }
-
- void iPush(PDAThread thread, Args args) {
- String arg = args.getNextStringArg();
- while (arg.length() != 0) {
- if (arg.startsWith("$")) { //$NON-NLS-1$
- String var = arg.substring(1);
- Object val = thread.fCurrentFrame.get(var);
- if (val == null)
+ bitField.fMnemonics.put(args.getNextStringArg(), Integer.valueOf(args.getNextIntArg()));
+ }
+ sendDebugEvent("registers", false); //$NON-NLS-1$
+ }
+
+ private String getRegisterPartOfName(String name) {
+ if (name.startsWith("$")) { //$NON-NLS-1$
+ int end = name.indexOf('.');
+ end = end != -1 ? end : name.length();
+ return name.substring(1, end);
+ }
+ return null;
+ }
+
+ private String getBitFieldPartOfName(String name) {
+ int start = name.indexOf('.');
+ if (name.startsWith("$") && start != -1) { //$NON-NLS-1$
+ return name.substring(start + 1, name.length());
+ }
+ return null;
+ }
+
+ /**
+ * @param thread
+ * @param args
+ */
+ void iDup(PDAThread thread, Args args) {
+ Object val = thread.fStack.pop();
+ thread.fStack.push(val);
+ thread.fStack.push(val);
+ }
+
+ void iExec(PDAThread thread, Args args) {
+ String label = args.getNextStringArg();
+ if (fLabels.containsKey(label)) {
+ int id = fNextThreadId++;
+ fThreads.put( Integer.valueOf(id), new PDAThread(id, label, fLabels.get(label).intValue()) );
+ sendDebugEvent("started " + id, false); //$NON-NLS-1$
+ } else {
+ sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
+ if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
+ thread.fSuspend = "event nosuchlabel"; //$NON-NLS-1$
+ thread.fCurrentFrame.fPC--;
+ }
+ }
+ }
+
+ /**
+ * @param thread
+ * @param args
+ */
+ void iHalt(PDAThread thread, Args args) {
+ thread.fRun = false;
+ }
+
+ /**
+ * @param thread
+ * @param args
+ */
+ void iOutput(PDAThread thread, Args args) {
+ System.out.println(thread.fStack.pop());
+ }
+
+ void iPop(PDAThread thread, Args args) {
+ String arg = args.getNextStringArg();
+ if (arg.startsWith("$")) { //$NON-NLS-1$
+ String var = arg.substring(1);
+ thread.fCurrentFrame.set(var, thread.fStack.pop());
+ String key = thread.fCurrentFrame.fFunction + "::" + var; //$NON-NLS-1$
+ if ( fWatchpoints.containsKey(key) && (fWatchpoints.get(key).intValue() & 2) != 0 ) {
+ fSuspendVM = thread.fID + " watch write " + key; //$NON-NLS-1$
+ }
+ } else {
+ thread.fStack.pop();
+ }
+ }
+
+ void iPush(PDAThread thread, Args args) {
+ String arg = args.getNextStringArg();
+ while (arg.length() != 0) {
+ if (arg.startsWith("$")) { //$NON-NLS-1$
+ String var = arg.substring(1);
+ Object val = thread.fCurrentFrame.get(var);
+ if (val == null)
{
val = "<undefined>"; //$NON-NLS-1$
}
- thread.fStack.push(val);
- String key = thread.fCurrentFrame.fFunction + "::" + var; //$NON-NLS-1$
- if (fWatchpoints.containsKey(key) && (fWatchpoints.get(key).intValue() & 1) != 0) {
- fSuspendVM = thread.fID + " watch read " + key; //$NON-NLS-1$
- }
- } else {
- Object val = arg;
- if (args.hasNextArg()) {
- while (args.hasNextArg()) {
- val = val.toString() + " " + args.getNextStringArg(); //$NON-NLS-1$
- }
- } else {
- try {
- val = Integer.valueOf(arg);
- } catch (NumberFormatException e) {
- }
- }
- thread.fStack.push(val);
- }
-
- arg = args.getNextStringArg();
- }
- }
-
- /**
- * @param thread
- * @param args
- */
- void iReturn(PDAThread thread, Args args) {
- if (!thread.fFrames.isEmpty()) {
- thread.fCurrentFrame = thread.fFrames.remove(thread.fFrames.size() - 1);
- } else {
- // Execution returned from the top frame, which means this thread
- // should exit.
- thread.fRun = false;
- }
- }
-
- void iVar(PDAThread thread, Args args) {
- String var = args.getNextStringArg();
- thread.fCurrentFrame.set(var, Integer.valueOf(0));
- }
-
- /**
- * @param thread
- * @param args
- */
- void iInternalEndEval(PDAThread thread, Args args) {
- Object result = thread.fStack.pop();
- thread.fThreadCode = fCode;
- thread.fThreadLabels = fLabels;
- thread.fCurrentFrame.fPC = thread.fSavedPC;
- sendDebugEvent("evalresult " + result, false); //$NON-NLS-1$
- thread.fSuspend = "eval"; //$NON-NLS-1$
- thread.fPerformingEval = false;
- }
+ thread.fStack.push(val);
+ String key = thread.fCurrentFrame.fFunction + "::" + var; //$NON-NLS-1$
+ if (fWatchpoints.containsKey(key) && (fWatchpoints.get(key).intValue() & 1) != 0) {
+ fSuspendVM = thread.fID + " watch read " + key; //$NON-NLS-1$
+ }
+ } else {
+ Object val = arg;
+ if (args.hasNextArg()) {
+ while (args.hasNextArg()) {
+ val = val.toString() + " " + args.getNextStringArg(); //$NON-NLS-1$
+ }
+ } else {
+ try {
+ val = Integer.valueOf(arg);
+ } catch (NumberFormatException e) {
+ }
+ }
+ thread.fStack.push(val);
+ }
+
+ arg = args.getNextStringArg();
+ }
+ }
+
+ /**
+ * @param thread
+ * @param args
+ */
+ void iReturn(PDAThread thread, Args args) {
+ if (!thread.fFrames.isEmpty()) {
+ thread.fCurrentFrame = thread.fFrames.remove(thread.fFrames.size() - 1);
+ } else {
+ // Execution returned from the top frame, which means this thread
+ // should exit.
+ thread.fRun = false;
+ }
+ }
+
+ void iVar(PDAThread thread, Args args) {
+ String var = args.getNextStringArg();
+ thread.fCurrentFrame.set(var, Integer.valueOf(0));
+ }
+
+ /**
+ * @param thread
+ * @param args
+ */
+ void iInternalEndEval(PDAThread thread, Args args) {
+ Object result = thread.fStack.pop();
+ thread.fThreadCode = fCode;
+ thread.fThreadLabels = fLabels;
+ thread.fCurrentFrame.fPC = thread.fSavedPC;
+ sendDebugEvent("evalresult " + result, false); //$NON-NLS-1$
+ thread.fSuspend = "eval"; //$NON-NLS-1$
+ thread.fPerformingEval = false;
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java
index 2469f6fdb..c1a21a99b 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java
@@ -90,85 +90,85 @@ public class PDALineBreakpoint extends LineBreakpoint implements IPDAEventListen
return false;
}
- /**
- * Installs this breakpoint in the given interprettor.
- * Registeres this breakpoint as an event listener in the
- * given target and creates the breakpoint specific request.
- *
- * @param target PDA interprettor
- * @throws CoreException if installation fails
- */
- public void install(PDADebugTarget target) throws CoreException {
- fTarget = target;
- target.addEventListener(this);
- createRequest(target);
- }
-
- /**
- * Create the breakpoint specific request in the target. Subclasses
- * should override.
- *
- * @param target PDA interprettor
- * @throws CoreException if request creation fails
- */
- protected void createRequest(PDADebugTarget target) throws CoreException {
+ /**
+ * Installs this breakpoint in the given interprettor.
+ * Registeres this breakpoint as an event listener in the
+ * given target and creates the breakpoint specific request.
+ *
+ * @param target PDA interprettor
+ * @throws CoreException if installation fails
+ */
+ public void install(PDADebugTarget target) throws CoreException {
+ fTarget = target;
+ target.addEventListener(this);
+ createRequest(target);
+ }
+
+ /**
+ * Create the breakpoint specific request in the target. Subclasses
+ * should override.
+ *
+ * @param target PDA interprettor
+ * @throws CoreException if request creation fails
+ */
+ protected void createRequest(PDADebugTarget target) throws CoreException {
//#ifdef ex3
//# // TODO: Exercise 3 - create breakpoint request in interpreter
//#else
- target.sendCommand(new PDASetBreakpointCommand((getLineNumber() - 1), false));
+ target.sendCommand(new PDASetBreakpointCommand((getLineNumber() - 1), false));
//#endif
- }
-
- /**
- * Removes this breakpoint's event request from the target. Subclasses
- * should override.
- *
- * @param target PDA interprettor
- * @throws CoreException if clearing the request fails
- */
- protected void clearRequest(PDADebugTarget target) throws CoreException {
+ }
+
+ /**
+ * Removes this breakpoint's event request from the target. Subclasses
+ * should override.
+ *
+ * @param target PDA interprettor
+ * @throws CoreException if clearing the request fails
+ */
+ protected void clearRequest(PDADebugTarget target) throws CoreException {
//#ifdef ex3
//# // TODO: Exercise 3 - clear breakpoint request in interpreter
//#else
- target.sendCommand(new PDAClearBreakpointCommand((getLineNumber() - 1)));
+ target.sendCommand(new PDAClearBreakpointCommand((getLineNumber() - 1)));
//#endif
- }
-
- /**
- * Removes this breakpoint from the given interprettor.
- * Removes this breakpoint as an event listener and clears
- * the request for the interprettor.
- *
- * @param target PDA interprettor
- * @throws CoreException if removal fails
- */
- public void remove(PDADebugTarget target) throws CoreException {
- target.removeEventListener(this);
- clearRequest(target);
- fTarget = null;
-
- }
-
- /**
- * Returns the target this breakpoint is installed in or <code>null</code>.
- *
- * @return the target this breakpoint is installed in or <code>null</code>
- */
- protected PDADebugTarget getDebugTarget() {
- return fTarget;
- }
-
- /**
- * Notify's the PDA interprettor that this breakpoint has been hit.
- */
- protected void notifyThread(int threadId) {
- if (fTarget != null) {
+ }
+
+ /**
+ * Removes this breakpoint from the given interprettor.
+ * Removes this breakpoint as an event listener and clears
+ * the request for the interprettor.
+ *
+ * @param target PDA interprettor
+ * @throws CoreException if removal fails
+ */
+ public void remove(PDADebugTarget target) throws CoreException {
+ target.removeEventListener(this);
+ clearRequest(target);
+ fTarget = null;
+
+ }
+
+ /**
+ * Returns the target this breakpoint is installed in or <code>null</code>.
+ *
+ * @return the target this breakpoint is installed in or <code>null</code>
+ */
+ protected PDADebugTarget getDebugTarget() {
+ return fTarget;
+ }
+
+ /**
+ * Notify's the PDA interprettor that this breakpoint has been hit.
+ */
+ protected void notifyThread(int threadId) {
+ if (fTarget != null) {
PDAThread thread = fTarget.getThread(threadId);
if (thread != null) {
- thread.suspendedBy(this);
- }
- }
- }
+ thread.suspendedBy(this);
+ }
+ }
+ }
/*
* Subclasses should override to handle their breakpoint specific event.
@@ -176,31 +176,31 @@ public class PDALineBreakpoint extends LineBreakpoint implements IPDAEventListen
@Override
public void handleEvent(PDAEvent event) {
if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
- PDARunControlEvent rcEvent = (PDARunControlEvent)event;
- if (rcEvent.fReason.equals("breakpoint")) { //$NON-NLS-1$
- handleHit(rcEvent);
- }
+ PDARunControlEvent rcEvent = (PDARunControlEvent)event;
+ if (rcEvent.fReason.equals("breakpoint")) { //$NON-NLS-1$
+ handleHit(rcEvent);
+ }
}
}
/**
- * Determines if this breakpoint was hit and notifies the thread.
- *
- * @param event breakpoint event
- */
- private void handleHit(PDARunControlEvent event) {
- int lastSpace = event.fMessage.lastIndexOf(' ');
- if (lastSpace > 0) {
- String line = event.fMessage.substring(lastSpace + 1);
- int lineNumber = Integer.parseInt(line);
- // breakpoints event line numbers are 0 based, model objects are 1 based
- lineNumber++;
- try {
+ * Determines if this breakpoint was hit and notifies the thread.
+ *
+ * @param event breakpoint event
+ */
+ private void handleHit(PDARunControlEvent event) {
+ int lastSpace = event.fMessage.lastIndexOf(' ');
+ if (lastSpace > 0) {
+ String line = event.fMessage.substring(lastSpace + 1);
+ int lineNumber = Integer.parseInt(line);
+ // breakpoints event line numbers are 0 based, model objects are 1 based
+ lineNumber++;
+ try {
if (getLineNumber() == lineNumber) {
notifyThread(event.fThreadId);
}
- } catch (CoreException e) {
- }
- }
- }
+ } catch (CoreException e) {
+ }
+ }
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java
index 41b0ae901..b126728b0 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java
@@ -34,14 +34,14 @@ import org.eclipse.debug.examples.core.pda.protocol.PDAWatchCommand;
*/
public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
- // 'read' or 'write' depending on what caused the last suspend for this watchpoint
- private String fLastSuspendType;
+ // 'read' or 'write' depending on what caused the last suspend for this watchpoint
+ private String fLastSuspendType;
- // marker attributes
- public static final String ACCESS = "ACCESS"; //$NON-NLS-1$
- public static final String MODIFICATION = "MODIFICATION"; //$NON-NLS-1$
- public static final String FUNCTION_NAME = "FUNCTION_NAME"; //$NON-NLS-1$
- public static final String VAR_NAME = "VAR_NAME"; //$NON-NLS-1$
+ // marker attributes
+ public static final String ACCESS = "ACCESS"; //$NON-NLS-1$
+ public static final String MODIFICATION = "MODIFICATION"; //$NON-NLS-1$
+ public static final String FUNCTION_NAME = "FUNCTION_NAME"; //$NON-NLS-1$
+ public static final String VAR_NAME = "VAR_NAME"; //$NON-NLS-1$
/**
* Default constructor is required for the breakpoint manager
@@ -49,7 +49,7 @@ public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
* the <code>setMarker(...)</code> method is called to restore
* this breakpoint's attributes.
*/
- public PDAWatchpoint() {
+ public PDAWatchpoint() {
}
/**
* Constructs a line breakpoint on the given resource at the given
@@ -80,134 +80,134 @@ public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
run(getMarkerRule(resource), runnable);
}
- @Override
+ @Override
public boolean isAccess() throws CoreException {
- return getMarker().getAttribute(ACCESS, true);
- }
+ return getMarker().getAttribute(ACCESS, true);
+ }
- @Override
+ @Override
public void setAccess(boolean access) throws CoreException {
- setAttribute(ACCESS, access);
- }
+ setAttribute(ACCESS, access);
+ }
- @Override
+ @Override
public boolean isModification() throws CoreException {
- return getMarker().getAttribute(MODIFICATION, true);
- }
+ return getMarker().getAttribute(MODIFICATION, true);
+ }
- @Override
+ @Override
public void setModification(boolean modification) throws CoreException {
- setAttribute(MODIFICATION, modification);
- }
+ setAttribute(MODIFICATION, modification);
+ }
- @Override
+ @Override
public boolean supportsAccess() {
- return true;
- }
+ return true;
+ }
- @Override
+ @Override
public boolean supportsModification() {
- return true;
- }
-
- /**
- * Sets the variable and function names the watchpoint is set on.
- *
- * @param functionName function name
- * @param variableName variable name
- * @throws CoreException if an exception occurrs setting marker attribtues
- */
- protected void setVariable(String functionName, String variableName) throws CoreException {
- setAttribute(VAR_NAME, variableName);
- setAttribute(FUNCTION_NAME, functionName);
- }
-
- /**
- * Returns the name of the variable this watchpoint is set on.
- *
- * @return the name of the variable this watchpoint is set on
- * @throws CoreException if unable to access the attribute
- */
- public String getVariableName() throws CoreException {
- return getMarker().getAttribute(VAR_NAME, (String)null);
- }
-
- /**
- * Returns the name of the function the variable associted with this watchpoint is defined in.
- *
- * @return the name of the function the variable associted with this watchpoint is defined in
- * @throws CoreException if unable to access the attribute
- */
- public String getFunctionName() throws CoreException {
- return getMarker().getAttribute(FUNCTION_NAME, (String)null);
- }
-
- /**
- * Sets the type of event that causes the last suspend event.
- *
- * @param description one of 'read' or 'write'
- */
- public void setSuspendType(String description) {
- fLastSuspendType = description;
- }
-
- /**
- * Returns the type of event that caused the last suspend.
- *
- * @return 'read', 'write', or <code>null</code> if undefined
- */
- public String getSuspendType() {
- return fLastSuspendType;
- }
+ return true;
+ }
+
+ /**
+ * Sets the variable and function names the watchpoint is set on.
+ *
+ * @param functionName function name
+ * @param variableName variable name
+ * @throws CoreException if an exception occurrs setting marker attribtues
+ */
+ protected void setVariable(String functionName, String variableName) throws CoreException {
+ setAttribute(VAR_NAME, variableName);
+ setAttribute(FUNCTION_NAME, functionName);
+ }
+
+ /**
+ * Returns the name of the variable this watchpoint is set on.
+ *
+ * @return the name of the variable this watchpoint is set on
+ * @throws CoreException if unable to access the attribute
+ */
+ public String getVariableName() throws CoreException {
+ return getMarker().getAttribute(VAR_NAME, (String)null);
+ }
+
+ /**
+ * Returns the name of the function the variable associted with this watchpoint is defined in.
+ *
+ * @return the name of the function the variable associted with this watchpoint is defined in
+ * @throws CoreException if unable to access the attribute
+ */
+ public String getFunctionName() throws CoreException {
+ return getMarker().getAttribute(FUNCTION_NAME, (String)null);
+ }
+
+ /**
+ * Sets the type of event that causes the last suspend event.
+ *
+ * @param description one of 'read' or 'write'
+ */
+ public void setSuspendType(String description) {
+ fLastSuspendType = description;
+ }
+
+ /**
+ * Returns the type of event that caused the last suspend.
+ *
+ * @return 'read', 'write', or <code>null</code> if undefined
+ */
+ public String getSuspendType() {
+ return fLastSuspendType;
+ }
@Override
protected void createRequest(PDADebugTarget target) throws CoreException {
- int flag = 0;
- if (isAccess()) {
- flag = flag | 1;
- }
- if (isModification()) {
- flag = flag | 2;
- }
+ int flag = 0;
+ if (isAccess()) {
+ flag = flag | 1;
+ }
+ if (isModification()) {
+ flag = flag | 2;
+ }
target.sendCommand(new PDAWatchCommand(getFunctionName(), getVariableName(), flag));
}
@Override
protected void clearRequest(PDADebugTarget target) throws CoreException {
- target.sendCommand(new PDAWatchCommand(getFunctionName(), getVariableName(), 0));
+ target.sendCommand(new PDAWatchCommand(getFunctionName(), getVariableName(), 0));
}
@Override
public void handleEvent(PDAEvent event) {
- if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
- PDARunControlEvent rcEvent = (PDARunControlEvent)event;
- if (rcEvent.fReason.equals("watch")) { //$NON-NLS-1$
- handleHit(rcEvent);
- }
- }
+ if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
+ PDARunControlEvent rcEvent = (PDARunControlEvent)event;
+ if (rcEvent.fReason.equals("watch")) { //$NON-NLS-1$
+ handleHit(rcEvent);
+ }
+ }
}
/**
- * Determines if this breakpoint was hit and notifies the thread.
- *
- * @param event breakpoint event
- */
- private void handleHit(PDARunControlEvent event) {
- String[] strings = event.fMessage.split(" "); //$NON-NLS-1$
- if (strings.length == 4) {
- String fv = strings[3];
- int j = fv.indexOf("::"); //$NON-NLS-1$
- if (j > 0) {
- String fcn = fv.substring(0, j);
- String var = fv.substring(j + 2);
+ * Determines if this breakpoint was hit and notifies the thread.
+ *
+ * @param event breakpoint event
+ */
+ private void handleHit(PDARunControlEvent event) {
+ String[] strings = event.fMessage.split(" "); //$NON-NLS-1$
+ if (strings.length == 4) {
+ String fv = strings[3];
+ int j = fv.indexOf("::"); //$NON-NLS-1$
+ if (j > 0) {
+ String fcn = fv.substring(0, j);
+ String var = fv.substring(j + 2);
try {
if (getVariableName().equals(var) && getFunctionName().equals(fcn)) {
setSuspendType(strings[2]);
- notifyThread(event.fThreadId);
+ notifyThread(event.fThreadId);
}
} catch (CoreException e) {
}
- }
- }
- }
+ }
+ }
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java
index 7a37de287..cb5a4223d 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java
@@ -55,22 +55,22 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
List<String> commandList = new ArrayList<>();
- // Get Java VM path
- String javaVMHome = System.getProperty("java.home"); //$NON-NLS-1$
- String javaVMExec = javaVMHome + File.separatorChar + "bin" + File.separatorChar + "java"; //$NON-NLS-1$ //$NON-NLS-2$
- if (File.separatorChar == '\\') {
- javaVMExec += ".exe"; //$NON-NLS-1$
- }
- File exe = new File(javaVMExec);
- if (!exe.exists()) {
- abort(MessageFormat.format("Specified java VM executable {0} does not exist.", new Object[]{javaVMExec}), null); //$NON-NLS-1$
- }
- commandList.add(javaVMExec);
-
- commandList.add("-cp"); //$NON-NLS-1$
- commandList.add(File.pathSeparator + DebugCorePlugin.getFileInPlugin(new Path("bin"))); //$NON-NLS-1$
-
- commandList.add("org.eclipse.debug.examples.pdavm.PDAVirtualMachine"); //$NON-NLS-1$
+ // Get Java VM path
+ String javaVMHome = System.getProperty("java.home"); //$NON-NLS-1$
+ String javaVMExec = javaVMHome + File.separatorChar + "bin" + File.separatorChar + "java"; //$NON-NLS-1$ //$NON-NLS-2$
+ if (File.separatorChar == '\\') {
+ javaVMExec += ".exe"; //$NON-NLS-1$
+ }
+ File exe = new File(javaVMExec);
+ if (!exe.exists()) {
+ abort(MessageFormat.format("Specified java VM executable {0} does not exist.", new Object[]{javaVMExec}), null); //$NON-NLS-1$
+ }
+ commandList.add(javaVMExec);
+
+ commandList.add("-cp"); //$NON-NLS-1$
+ commandList.add(File.pathSeparator + DebugCorePlugin.getFileInPlugin(new Path("bin"))); //$NON-NLS-1$
+
+ commandList.add("org.eclipse.debug.examples.pdavm.PDAVirtualMachine"); //$NON-NLS-1$
// program name
String program = configuration.getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null);
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java
index 37fbc949d..338de32e8 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java
@@ -45,50 +45,50 @@ public class PDADebugElement extends DebugElement {
}
/**
- * Sends a request to the PDA interpreter, waits for and returns the reply.
- *
- * @param request command
- * @return reply
- * @throws DebugException if the request fails
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDATerminateCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAVMResumeCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDASuspendCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAResumeCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAStepCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDADropFrameCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDASetBreakpointCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAClearBreakpointCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAWatchCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDADataCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDASetDataCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAPopDataCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAPushDataCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAEvalCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAEventStopCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAStackCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAStackDepthCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAFrameCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDASetVarCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAVarCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAChildrenCommand
- *
- * @see org.eclipse.debug.examples.core.pda.protocol.PDAGroupsCommand
- * @see org.eclipse.debug.examples.core.pda.protocol.PDARegistersCommand
- *
- * @since 3.5
- */
+ * Sends a request to the PDA interpreter, waits for and returns the reply.
+ *
+ * @param request command
+ * @return reply
+ * @throws DebugException if the request fails
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDATerminateCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAVMResumeCommand
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDASuspendCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAResumeCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAStepCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDADropFrameCommand
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDASetBreakpointCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAClearBreakpointCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAWatchCommand
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDADataCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDASetDataCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAPopDataCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAPushDataCommand
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAEvalCommand
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAEventStopCommand
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAStackCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAStackDepthCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAFrameCommand
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDASetVarCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAVarCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAChildrenCommand
+ *
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDAGroupsCommand
+ * @see org.eclipse.debug.examples.core.pda.protocol.PDARegistersCommand
+ *
+ * @since 3.5
+ */
public PDACommandResult sendCommand(PDACommand command) throws DebugException {
- return getPDADebugTarget().sendCommand(command);
- }
+ return getPDADebugTarget().sendCommand(command);
+ }
/**
* Returns the debug target as a PDA target.
@@ -96,15 +96,15 @@ public class PDADebugElement extends DebugElement {
* @return PDA debug target
*/
protected PDADebugTarget getPDADebugTarget() {
- return (PDADebugTarget) getDebugTarget();
+ return (PDADebugTarget) getDebugTarget();
}
/**
* Returns the breakpoint manager
*
- * @return the breakpoint manager
- */
- protected IBreakpointManager getBreakpointManager() {
- return DebugPlugin.getDefault().getBreakpointManager();
- }
+ * @return the breakpoint manager
+ */
+ protected IBreakpointManager getBreakpointManager() {
+ return DebugPlugin.getDefault().getBreakpointManager();
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java
index daf2a0709..9685b6f6e 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java
@@ -117,15 +117,15 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
try {
message = fEventReader.readLine();
if (message != null) {
- PDAEvent event = null;
- try {
- event = PDAEvent.parseEvent(message);
- }
- catch (IllegalArgumentException e) {
- DebugCorePlugin.getDefault().getLog().log(
- new Status (IStatus.ERROR, "org.eclipse.debug.examples.core", "Error parsing PDA event", e)); //$NON-NLS-1$ //$NON-NLS-2$
- continue;
- }
+ PDAEvent event = null;
+ try {
+ event = PDAEvent.parseEvent(message);
+ }
+ catch (IllegalArgumentException e) {
+ DebugCorePlugin.getDefault().getLog().log(
+ new Status (IStatus.ERROR, "org.eclipse.debug.examples.core", "Error parsing PDA event", e)); //$NON-NLS-1$ //$NON-NLS-2$
+ continue;
+ }
Object[] listeners = fEventListeners.toArray();
for (int i = 0; i < listeners.length; i++) {
((IPDAEventListener)listeners[i]).handleEvent(event);
@@ -148,11 +148,11 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
* @param listener event listener
*/
public void addEventListener(IPDAEventListener listener) {
- synchronized(fEventListeners) {
- if (!fEventListeners.contains(listener)) {
- fEventListeners.add(listener);
- }
- }
+ synchronized(fEventListeners) {
+ if (!fEventListeners.contains(listener)) {
+ fEventListeners.add(listener);
+ }
+ }
}
/**
@@ -204,12 +204,12 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
fEventDispatch = new EventDispatchJob();
fEventDispatch.schedule();
IBreakpointManager breakpointManager = getBreakpointManager();
- breakpointManager.addBreakpointListener(this);
+ breakpointManager.addBreakpointListener(this);
breakpointManager.addBreakpointManagerListener(this);
// initialize error hanlding to suspend on 'unimplemented instructions'
// and 'no such label' errors
sendCommand(new PDAEventStopCommand(PDAEventStopCommand.UNIMPINSTR, true));
- sendCommand(new PDAEventStopCommand(PDAEventStopCommand.NOSUCHLABEL, true));
+ sendCommand(new PDAEventStopCommand(PDAEventStopCommand.NOSUCHLABEL, true));
}
@Override
@@ -218,9 +218,9 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
}
@Override
public IThread[] getThreads() throws DebugException {
- synchronized (fThreads) {
- return fThreads.values().toArray(new IThread[fThreads.size()]);
- }
+ synchronized (fThreads) {
+ return fThreads.values().toArray(new IThread[fThreads.size()]);
+ }
}
@Override
public boolean hasThreads() throws DebugException {
@@ -282,7 +282,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
//#ifdef ex2
//# // TODO: Exercise 2 - send termination request to interpreter
//#else
- sendCommand(new PDATerminateCommand());
+ sendCommand(new PDATerminateCommand());
//#endif
}
@@ -303,12 +303,12 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
@Override
public void resume() throws DebugException {
- sendCommand(new PDAVMResumeCommand());
+ sendCommand(new PDAVMResumeCommand());
}
@Override
public void suspend() throws DebugException {
- sendCommand(new PDAVMSuspendCommand());
+ sendCommand(new PDAVMSuspendCommand());
}
@Override
@@ -317,7 +317,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
try {
if ((breakpoint.isEnabled() && getBreakpointManager().isEnabled()) || !breakpoint.isRegistered()) {
PDALineBreakpoint pdaBreakpoint = (PDALineBreakpoint)breakpoint;
- pdaBreakpoint.install(this);
+ pdaBreakpoint.install(this);
}
} catch (CoreException e) {
}
@@ -328,7 +328,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
if (supportsBreakpoint(breakpoint)) {
try {
- PDALineBreakpoint pdaBreakpoint = (PDALineBreakpoint)breakpoint;
+ PDALineBreakpoint pdaBreakpoint = (PDALineBreakpoint)breakpoint;
pdaBreakpoint.remove(this);
} catch (CoreException e) {
}
@@ -405,58 +405,58 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
setTerminated(true);
fThreads.clear();
IBreakpointManager breakpointManager = getBreakpointManager();
- breakpointManager.removeBreakpointListener(this);
+ breakpointManager.removeBreakpointListener(this);
breakpointManager.removeBreakpointManagerListener(this);
fireTerminateEvent();
removeEventListener(this);
}
private void vmResumed(PDAVMResumedEvent event) {
- setVMSuspended(false);
- fireResumeEvent(calcDetail(event.fReason));
+ setVMSuspended(false);
+ fireResumeEvent(calcDetail(event.fReason));
}
private void vmSuspended(PDAVMSuspendedEvent event) {
- setVMSuspended(true);
- fireSuspendEvent(calcDetail(event.fReason));
+ setVMSuspended(true);
+ fireSuspendEvent(calcDetail(event.fReason));
}
private int calcDetail(String reason) {
- if (reason.equals("breakpoint") || reason.equals("watch")) { //$NON-NLS-1$ //$NON-NLS-2$
- return DebugEvent.BREAKPOINT;
- } else if (reason.equals("step")) { //$NON-NLS-1$
- return DebugEvent.STEP_OVER;
- } else if (reason.equals("drop")) { //$NON-NLS-1$
- return DebugEvent.STEP_RETURN;
- } else if (reason.equals("client")) { //$NON-NLS-1$
- return DebugEvent.CLIENT_REQUEST;
- } else if (reason.equals("event")) { //$NON-NLS-1$
- return DebugEvent.BREAKPOINT;
- } else {
- return DebugEvent.UNSPECIFIED;
- }
+ if (reason.equals("breakpoint") || reason.equals("watch")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return DebugEvent.BREAKPOINT;
+ } else if (reason.equals("step")) { //$NON-NLS-1$
+ return DebugEvent.STEP_OVER;
+ } else if (reason.equals("drop")) { //$NON-NLS-1$
+ return DebugEvent.STEP_RETURN;
+ } else if (reason.equals("client")) { //$NON-NLS-1$
+ return DebugEvent.CLIENT_REQUEST;
+ } else if (reason.equals("event")) { //$NON-NLS-1$
+ return DebugEvent.BREAKPOINT;
+ } else {
+ return DebugEvent.UNSPECIFIED;
+ }
}
private void started(PDAStartedEvent event) {
- PDAThread newThread = new PDAThread(this, event.fThreadId);
- fThreads.put(Integer.valueOf(event.fThreadId), newThread);
- newThread.start();
+ PDAThread newThread = new PDAThread(this, event.fThreadId);
+ fThreads.put(Integer.valueOf(event.fThreadId), newThread);
+ newThread.start();
}
private void exited(PDAExitedEvent event) {
- PDAThread thread = fThreads.remove(Integer.valueOf(event.fThreadId));
- if (thread != null) {
- thread.exit();
- }
+ PDAThread thread = fThreads.remove(Integer.valueOf(event.fThreadId));
+ if (thread != null) {
+ thread.exit();
+ }
}
private synchronized void setVMSuspended(boolean suspended) {
- fVMSuspended = suspended;
+ fVMSuspended = suspended;
}
- private synchronized void setTerminated(boolean terminated) {
- fTerminated = terminated;
- }
+ private synchronized void setTerminated(boolean terminated) {
+ fTerminated = terminated;
+ }
private String sendRequest(String request) throws DebugException {
synchronized (fRequestSocket) {
@@ -466,7 +466,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
// wait for reply
String retVal = fRequestReader.readLine();
if (retVal == null) {
- requestFailed("Request failed: " + request + ". Debugger connection closed.", null); //$NON-NLS-1$ //$NON-NLS-2$
+ requestFailed("Request failed: " + request + ". Debugger connection closed.", null); //$NON-NLS-1$ //$NON-NLS-2$
}
return retVal;
} catch (IOException e) {
@@ -479,8 +479,8 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
@Override
public PDACommandResult sendCommand(PDACommand command) throws DebugException {
- String response = sendRequest(command.getRequest());
- return command.createResult(response);
+ String response = sendRequest(command.getRequest());
+ return command.createResult(response);
}
/**
@@ -496,7 +496,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
} else {
breakpointRemoved(breakpoints[i], null);
}
- }
+ }
}
@Override
@@ -505,15 +505,15 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
started((PDAStartedEvent)event);
} else if (event instanceof PDAExitedEvent) {
exited((PDAExitedEvent)event);
- } else if (event instanceof PDAVMStartedEvent) {
- vmStarted((PDAVMStartedEvent)event);
+ } else if (event instanceof PDAVMStartedEvent) {
+ vmStarted((PDAVMStartedEvent)event);
} else if (event instanceof PDAVMTerminatedEvent) {
- vmTerminated();
- } else if (event instanceof PDAVMSuspendedEvent) {
- vmSuspended((PDAVMSuspendedEvent)event);
- } else if (event instanceof PDAVMResumedEvent) {
- vmResumed((PDAVMResumedEvent)event);
- }
+ vmTerminated();
+ } else if (event instanceof PDAVMSuspendedEvent) {
+ vmSuspended((PDAVMSuspendedEvent)event);
+ } else if (event instanceof PDAVMResumedEvent) {
+ vmResumed((PDAVMResumedEvent)event);
+ }
}
/**
@@ -526,15 +526,15 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
* if terminated
*/
public PDAThread getThread(int threadId) {
- if (threadId > 0) {
- return fThreads.get(Integer.valueOf(threadId));
- } else {
- synchronized(fThreads) {
- if (fThreads.size() > 0) {
- return fThreads.values().iterator().next();
- }
- }
- }
+ if (threadId > 0) {
+ return fThreads.get(Integer.valueOf(threadId));
+ } else {
+ synchronized(fThreads) {
+ if (fThreads.size() > 0) {
+ return fThreads.values().iterator().next();
+ }
+ }
+ }
return null;
}
@@ -544,7 +544,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
* @throws DebugException
*/
public void restart() throws DebugException {
- sendCommand(new PDARestartCommand());
- }
+ sendCommand(new PDARestartCommand());
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java
index fdd7cde92..761ea8211 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java
@@ -221,15 +221,15 @@ public class PDAStackFrame extends PDADebugElement implements IStackFrame {
return fId;
}
- /**
- * Returns the stack frame's thread's unique identifier
- *
- * @return this stack frame's thread's unique identifier
- *
- * @since 3.5
- */
+ /**
+ * Returns the stack frame's thread's unique identifier
+ *
+ * @return this stack frame's thread's unique identifier
+ *
+ * @since 3.5
+ */
protected int getThreadIdentifier() {
- return fThread.getIdentifier();
+ return fThread.getIdentifier();
}
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java
index 6eda5867b..007c5c25b 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java
@@ -24,17 +24,17 @@ import org.eclipse.debug.core.model.IVariable;
*/
public class PDAStackValue extends PDADebugElement implements IValue {
- final private PDAThread fThread;
- final private String fValue;
- final private int fIndex;
+ final private PDAThread fThread;
+ final private String fValue;
+ final private int fIndex;
- /**
- * Constructs a value that appears on the data stack
- *
- * @param target debug target
- * @param value value on the stack
- * @param index index on the stack
- */
+ /**
+ * Constructs a value that appears on the data stack
+ *
+ * @param target debug target
+ * @param value value on the stack
+ * @param index index on the stack
+ */
public PDAStackValue(PDAThread thread, String value, int index) {
super(thread.getDebugTarget());
fThread = thread;
@@ -43,43 +43,43 @@ public class PDAStackValue extends PDADebugElement implements IValue {
}
public PDAThread getThread() {
- return fThread;
+ return fThread;
}
- @Override
+ @Override
public String getValueString() throws DebugException {
- return fValue;
- }
+ return fValue;
+ }
- @Override
+ @Override
public boolean isAllocated() throws DebugException {
- return true;
- }
+ return true;
+ }
- @Override
+ @Override
public IVariable[] getVariables() throws DebugException {
- return new IVariable[0];
- }
+ return new IVariable[0];
+ }
- @Override
+ @Override
public boolean hasVariables() throws DebugException {
- return false;
- }
+ return false;
+ }
- @Override
+ @Override
public String getReferenceTypeName() throws DebugException {
- return null;
- }
+ return null;
+ }
- @Override
+ @Override
public boolean equals(Object obj) {
- return obj instanceof PDAStackValue &&
- ((PDAStackValue)obj).fValue.equals(fValue) &&
- ((PDAStackValue)obj).fIndex == fIndex;
- }
+ return obj instanceof PDAStackValue &&
+ ((PDAStackValue)obj).fValue.equals(fValue) &&
+ ((PDAStackValue)obj).fIndex == fIndex;
+ }
- @Override
+ @Override
public int hashCode() {
- return super.hashCode() + fIndex;
- }
+ return super.hashCode() + fIndex;
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java
index 19913ecf7..b72fa1b18 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java
@@ -50,10 +50,10 @@ import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent;
*/
public class PDAThread extends PDADebugElement implements IThread, IPDAEventListener {
- /**
- * ID of this thread as reported by PDA.
- */
- private final int fThreadId;
+ /**
+ * ID of this thread as reported by PDA.
+ */
+ private final int fThreadId;
/**
* Breakpoint this thread is suspended at or <code>null</code>
@@ -97,29 +97,29 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
* @since 3.5
*/
void start() {
- fireCreationEvent();
- getPDADebugTarget().addEventListener(this);
+ fireCreationEvent();
+ getPDADebugTarget().addEventListener(this);
}
- /**
- * Called by the debug target before the thread is removed.
- *
- * @since 3.5
- */
+ /**
+ * Called by the debug target before the thread is removed.
+ *
+ * @since 3.5
+ */
void exit() {
- getPDADebugTarget().removeEventListener(this);
- fireTerminateEvent();
+ getPDADebugTarget().removeEventListener(this);
+ fireTerminateEvent();
}
@Override
public IStackFrame[] getStackFrames() throws DebugException {
if (isSuspended()) {
- PDAStackCommandResult result = (PDAStackCommandResult)sendCommand(new PDAStackCommand(fThreadId));
- IStackFrame[] frames = new IStackFrame[result.fFrames.length];
- for (int i = 0; i < result.fFrames.length; i++) {
- frames[frames.length - i - 1] = new PDAStackFrame(this, result.fFrames[i], i);
+ PDAStackCommandResult result = (PDAStackCommandResult)sendCommand(new PDAStackCommand(fThreadId));
+ IStackFrame[] frames = new IStackFrame[result.fFrames.length];
+ for (int i = 0; i < result.fFrames.length; i++) {
+ frames[frames.length - i - 1] = new PDAStackFrame(this, result.fFrames[i], i);
}
- return frames;
+ return frames;
}
return new IStackFrame[0];
}
@@ -178,15 +178,15 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
@Override
public boolean isSuspended() {
- if (getDebugTarget().isTerminated()) {
- return false;
- }
- if (getDebugTarget().isSuspended()) {
- return true;
- }
- synchronized (this) {
- return fSuspended;
- }
+ if (getDebugTarget().isTerminated()) {
+ return false;
+ }
+ if (getDebugTarget().isSuspended()) {
+ return true;
+ }
+ synchronized (this) {
+ return fSuspended;
+ }
}
@Override
@@ -203,7 +203,7 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
//#ifdef ex2
//# // TODO: Exercise 2 - send suspend request to interpreter
//#else
- sendCommand(new PDASuspendCommand(fThreadId));
+ sendCommand(new PDASuspendCommand(fThreadId));
//#endif
}
@@ -252,7 +252,7 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
@Override
public void terminate() throws DebugException {
- getDebugTarget().terminate();
+ getDebugTarget().terminate();
}
/**
@@ -296,64 +296,64 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
@Override
public void handleEvent(PDAEvent _event) {
- if (_event instanceof PDARunControlEvent && fThreadId == ((PDARunControlEvent)_event).fThreadId) {
- PDARunControlEvent event = (PDARunControlEvent)_event;
- // clear previous state
- fBreakpoint = null;
- setStepping(false);
-
- // handle events
- if (event instanceof PDAResumedEvent || event instanceof PDAVMResumedEvent) {
- setSuspended(false);
- if ("step".equals(event.fReason)) { //$NON-NLS-1$
- setStepping(true);
- resumed(DebugEvent.STEP_OVER);
- //#ifdef ex2
- //# }
- //# // TODO: Exercise 2 - handle/fire "client" resume event
- //#else
- } else if ("client".equals(event.fReason)) { //$NON-NLS-1$
- resumed(DebugEvent.CLIENT_REQUEST);
- }
- //#endif
- //#ifdef ex5
- //# // TODO: Exercise 5 - handle start of drop event
- //#else
- else if ("drop".equals(event.fReason)) { //$NON-NLS-1$
- resumed(DebugEvent.STEP_RETURN);
- }
- //#endif
- } else if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
- setSuspended(true);
- //#ifdef ex2
- //# // TODO: Exercise 2 - handle/fire "client" suspend event
- //# if (event.endsWith("step")) {
- //# suspended(DebugEvent.STEP_END);
- //# } else if (event.startsWith("suspended event") && getError() != null) {
- //# exceptionHit();
- //# }
- //#else
- if ("client".equals(event.fReason)) { //$NON-NLS-1$
- suspended(DebugEvent.CLIENT_REQUEST);
- } else if ("step".equals(event.fReason)) { //$NON-NLS-1$
- suspended(DebugEvent.STEP_END);
- } else if ("event".equals(event.fReason) && getError() != null) { //$NON-NLS-1$
- exceptionHit();
- }
- //#endif
- //#ifdef ex5
- //# // TODO: Exercise 5 - handle end of drop event
- //#else
- else if ("drop".equals(event.fReason)) { //$NON-NLS-1$
- suspended(DebugEvent.STEP_END);
- }
- //#endif
- } else if (_event instanceof PDANoSuchLabelEvent ||
- _event instanceof PDAUnimplementedInstructionEvent)
- {
- setError(event.fMessage);
- }
- }
+ if (_event instanceof PDARunControlEvent && fThreadId == ((PDARunControlEvent)_event).fThreadId) {
+ PDARunControlEvent event = (PDARunControlEvent)_event;
+ // clear previous state
+ fBreakpoint = null;
+ setStepping(false);
+
+ // handle events
+ if (event instanceof PDAResumedEvent || event instanceof PDAVMResumedEvent) {
+ setSuspended(false);
+ if ("step".equals(event.fReason)) { //$NON-NLS-1$
+ setStepping(true);
+ resumed(DebugEvent.STEP_OVER);
+ //#ifdef ex2
+ //# }
+ //# // TODO: Exercise 2 - handle/fire "client" resume event
+ //#else
+ } else if ("client".equals(event.fReason)) { //$NON-NLS-1$
+ resumed(DebugEvent.CLIENT_REQUEST);
+ }
+ //#endif
+ //#ifdef ex5
+ //# // TODO: Exercise 5 - handle start of drop event
+ //#else
+ else if ("drop".equals(event.fReason)) { //$NON-NLS-1$
+ resumed(DebugEvent.STEP_RETURN);
+ }
+ //#endif
+ } else if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
+ setSuspended(true);
+ //#ifdef ex2
+ //# // TODO: Exercise 2 - handle/fire "client" suspend event
+ //# if (event.endsWith("step")) {
+ //# suspended(DebugEvent.STEP_END);
+ //# } else if (event.startsWith("suspended event") && getError() != null) {
+ //# exceptionHit();
+ //# }
+ //#else
+ if ("client".equals(event.fReason)) { //$NON-NLS-1$
+ suspended(DebugEvent.CLIENT_REQUEST);
+ } else if ("step".equals(event.fReason)) { //$NON-NLS-1$
+ suspended(DebugEvent.STEP_END);
+ } else if ("event".equals(event.fReason) && getError() != null) { //$NON-NLS-1$
+ exceptionHit();
+ }
+ //#endif
+ //#ifdef ex5
+ //# // TODO: Exercise 5 - handle end of drop event
+ //#else
+ else if ("drop".equals(event.fReason)) { //$NON-NLS-1$
+ suspended(DebugEvent.STEP_END);
+ }
+ //#endif
+ } else if (_event instanceof PDANoSuchLabelEvent ||
+ _event instanceof PDAUnimplementedInstructionEvent)
+ {
+ setError(event.fMessage);
+ }
+ }
}
/**
@@ -380,12 +380,12 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
}
/**
- * Notification an error was encountered. Fires a breakpoint
- * suspend event.
- */
- private void exceptionHit() {
- suspended(DebugEvent.BREAKPOINT);
- }
+ * Notification an error was encountered. Fires a breakpoint
+ * suspend event.
+ */
+ private void exceptionHit() {
+ suspended(DebugEvent.BREAKPOINT);
+ }
/**
* Sets the current variables for the given stack frame. Called
@@ -421,8 +421,8 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
* Pops the top frame off the callstack.
*
* @throws DebugException
- *
- * @since 3.5
+ *
+ * @since 3.5
*/
public void popFrame() throws DebugException {
//#ifdef ex5
@@ -451,89 +451,89 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
return false;
}
- /**
- * Returns the values on the data stack (top down)
- *
- * @return the values on the data stack (top down)
- *
- * @since 3.5
- */
- public IValue[] getDataStack() throws DebugException {
- PDAListResult result = (PDAListResult)sendCommand(new PDADataCommand(fThreadId));
- if (result.fValues.length > 0) {
- IValue[] values = new IValue[result.fValues.length];
- for (int i = 0; i < result.fValues.length; i++) {
- values[values.length - i - 1] = new PDAStackValue(this, result.fValues[i], i);
- }
- return values;
- }
- return new IValue[0];
- }
-
- /**
- * Returns whether popping the data stack is currently permitted
- *
- * @return whether popping the data stack is currently permitted
- *
- * @since 3.5
- */
- public boolean canPopData() {
- try {
- return !isTerminated() && isSuspended() && getDataStack().length > 0;
- } catch (DebugException e) {
- }
- return false;
- }
-
- /**
- * Pops and returns the top of the data stack
- *
- * @return the top value on the stack
- * @throws DebugException if the stack is empty or the request fails
- *
- * @since 3.5
- */
- public IValue popData() throws DebugException {
- IValue[] dataStack = getDataStack();
- if (dataStack.length > 0) {
- sendCommand(new PDAPopDataCommand(fThreadId));
- return dataStack[0];
- }
- requestFailed("Empty stack", null); //$NON-NLS-1$
- return null;
- }
-
- /**
- * Returns whether pushing a value is currently supported.
- *
- * @return whether pushing a value is currently supported
- *
- * @since 3.5
- */
- public boolean canPushData() {
- return !isTerminated() && isSuspended();
- }
-
- /**
- * Pushes a value onto the stack.
- *
- * @param value value to push
- * @throws DebugException on failure
- *
- * @since 3.5
- */
- public void pushData(String value) throws DebugException {
- sendCommand(new PDAPushDataCommand(fThreadId, value));
- }
-
- /**
- * Returns this thread's unique identifier
- *
- * @return this thread's unique identifier
- *
- * @since 3.5
- */
+ /**
+ * Returns the values on the data stack (top down)
+ *
+ * @return the values on the data stack (top down)
+ *
+ * @since 3.5
+ */
+ public IValue[] getDataStack() throws DebugException {
+ PDAListResult result = (PDAListResult)sendCommand(new PDADataCommand(fThreadId));
+ if (result.fValues.length > 0) {
+ IValue[] values = new IValue[result.fValues.length];
+ for (int i = 0; i < result.fValues.length; i++) {
+ values[values.length - i - 1] = new PDAStackValue(this, result.fValues[i], i);
+ }
+ return values;
+ }
+ return new IValue[0];
+ }
+
+ /**
+ * Returns whether popping the data stack is currently permitted
+ *
+ * @return whether popping the data stack is currently permitted
+ *
+ * @since 3.5
+ */
+ public boolean canPopData() {
+ try {
+ return !isTerminated() && isSuspended() && getDataStack().length > 0;
+ } catch (DebugException e) {
+ }
+ return false;
+ }
+
+ /**
+ * Pops and returns the top of the data stack
+ *
+ * @return the top value on the stack
+ * @throws DebugException if the stack is empty or the request fails
+ *
+ * @since 3.5
+ */
+ public IValue popData() throws DebugException {
+ IValue[] dataStack = getDataStack();
+ if (dataStack.length > 0) {
+ sendCommand(new PDAPopDataCommand(fThreadId));
+ return dataStack[0];
+ }
+ requestFailed("Empty stack", null); //$NON-NLS-1$
+ return null;
+ }
+
+ /**
+ * Returns whether pushing a value is currently supported.
+ *
+ * @return whether pushing a value is currently supported
+ *
+ * @since 3.5
+ */
+ public boolean canPushData() {
+ return !isTerminated() && isSuspended();
+ }
+
+ /**
+ * Pushes a value onto the stack.
+ *
+ * @param value value to push
+ * @throws DebugException on failure
+ *
+ * @since 3.5
+ */
+ public void pushData(String value) throws DebugException {
+ sendCommand(new PDAPushDataCommand(fThreadId, value));
+ }
+
+ /**
+ * Returns this thread's unique identifier
+ *
+ * @return this thread's unique identifier
+ *
+ * @since 3.5
+ */
public int getIdentifier() {
- return fThreadId;
+ return fThreadId;
}
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java
index 24a8ef402..fe1452c4c 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java
@@ -26,7 +26,7 @@ import org.eclipse.debug.examples.core.pda.protocol.PDAListResult;
*/
public class PDAValue extends PDADebugElement implements IValue {
- final private PDAVariable fVariable;
+ final private PDAVariable fVariable;
final private String fValue;
public PDAValue(PDAVariable variable, String value) {
@@ -57,46 +57,46 @@ public class PDAValue extends PDADebugElement implements IValue {
@Override
public IVariable[] getVariables() throws DebugException {
- PDAStackFrame frame = fVariable.getStackFrame();
- PDAListResult result = (PDAListResult) sendCommand(
- new PDAChildrenCommand(frame.getThreadIdentifier(), frame.getIdentifier(), fVariable.getName()) );
+ PDAStackFrame frame = fVariable.getStackFrame();
+ PDAListResult result = (PDAListResult) sendCommand(
+ new PDAChildrenCommand(frame.getThreadIdentifier(), frame.getIdentifier(), fVariable.getName()) );
- IVariable[] children = new IVariable[result.fValues.length];
- for(int i = 0; i < result.fValues.length; i++) {
- children[i] = new PDAVariable(frame, result.fValues[i]);
- }
+ IVariable[] children = new IVariable[result.fValues.length];
+ for(int i = 0; i < result.fValues.length; i++) {
+ children[i] = new PDAVariable(frame, result.fValues[i]);
+ }
return children;
}
@Override
public boolean hasVariables() throws DebugException {
- if (getVariables().length != 0) {
- return true;
- }
- // Value with multiple words can be show as an array using logical
- // structures. If the value has multiple words, it needs to indicate
- // that it has children even if logical structures are not turned on.
+ if (getVariables().length != 0) {
+ return true;
+ }
+ // Value with multiple words can be show as an array using logical
+ // structures. If the value has multiple words, it needs to indicate
+ // that it has children even if logical structures are not turned on.
return fValue.split("\\W+").length > 1; //$NON-NLS-1$
}
- @Override
+ @Override
public boolean equals(Object obj) {
- return obj instanceof PDAValue && ((PDAValue)obj).fValue.equals(fValue);
- }
+ return obj instanceof PDAValue && ((PDAValue)obj).fValue.equals(fValue);
+ }
- @Override
+ @Override
public int hashCode() {
- return fValue.hashCode();
- }
+ return fValue.hashCode();
+ }
- /**
- * Returns the variable that this value was created for.
- *
- * @return The variable that this value was created for.
- *
- * @since 3.5
- */
- public PDAVariable getVariable() {
- return fVariable;
- }
+ /**
+ * Returns the variable that this value was created for.
+ *
+ * @return The variable that this value was created for.
+ *
+ * @since 3.5
+ */
+ public PDAVariable getVariable() {
+ return fVariable;
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java
index afe1d7f9c..4db49c209 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java
@@ -49,7 +49,7 @@ public class PDAVariable extends PDADebugElement implements IVariable {
@Override
public IValue getValue() throws DebugException {
PDACommandResult result = sendCommand(new PDAVarCommand(
- fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName()));
+ fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName()));
return new PDAValue(this, result.fResponseText);
}
@@ -70,8 +70,8 @@ public class PDAVariable extends PDADebugElement implements IVariable {
@Override
public void setValue(String expression) throws DebugException {
- sendCommand(new PDASetVarCommand(
- fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName(), expression));
+ sendCommand(new PDASetVarCommand(
+ fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName(), expression));
fireChangeEvent(DebugEvent.CONTENT);
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java
index 7f407eed0..6188ccddf 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java
@@ -25,21 +25,21 @@ import java.util.StringTokenizer;
*/
public class PDABitFieldData {
- final public String fName;
- final public int fOffset;
- final public int fCount;
+ final public String fName;
+ final public int fOffset;
+ final public int fCount;
final public Map<String, String> fMnemonics;
- PDABitFieldData(String bitFieldString) {
- StringTokenizer st = new StringTokenizer(bitFieldString, " "); //$NON-NLS-1$
+ PDABitFieldData(String bitFieldString) {
+ StringTokenizer st = new StringTokenizer(bitFieldString, " "); //$NON-NLS-1$
- fName = st.nextToken();
- fOffset = Integer.parseInt(st.nextToken());
- fCount = Integer.parseInt(st.nextToken());
+ fName = st.nextToken();
+ fOffset = Integer.parseInt(st.nextToken());
+ fCount = Integer.parseInt(st.nextToken());
fMnemonics = new LinkedHashMap<>(0);
- while (st.hasMoreTokens()) {
- fMnemonics.put(st.nextToken(), st.nextToken());
- }
- }
+ while (st.hasMoreTokens()) {
+ fMnemonics.put(st.nextToken(), st.nextToken());
+ }
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java
index 4ae78a10b..f85431b7c 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java
@@ -28,12 +28,12 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAChildrenCommand extends PDACommand {
- public PDAChildrenCommand(int threadId, int frameId, String name ) {
- super("children " + threadId + " " + frameId + " " + name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
+ public PDAChildrenCommand(int threadId, int frameId, String name ) {
+ super("children " + threadId + " " + frameId + " " + name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDAListResult(resultText);
- }
+ return new PDAListResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java
index ceb16884f..45a383b38 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java
@@ -25,12 +25,12 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAClearBreakpointCommand extends PDACommand {
- public PDAClearBreakpointCommand(int line) {
- super("clear " + line); //$NON-NLS-1$
- }
+ public PDAClearBreakpointCommand(int line) {
+ super("clear " + line); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java
index cb2ea671c..b04f388a9 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java
@@ -20,24 +20,24 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
abstract public class PDACommand {
- final private String fRequest;
+ final private String fRequest;
- public PDACommand(String request) {
- fRequest = request;
- }
+ public PDACommand(String request) {
+ fRequest = request;
+ }
- /**
- * Returns the request to be sent to PDA.
- */
- public String getRequest() {
- return fRequest;
- }
+ /**
+ * Returns the request to be sent to PDA.
+ */
+ public String getRequest() {
+ return fRequest;
+ }
- /**
- * Returns the command result based on the given PDA response. This command
- * uses the class type parameter as the return type to allow the compiler to
- * enforce the correct command result. This class must be implemented by
- * each command to create the concrete result type.
- */
- abstract public PDACommandResult createResult(String resultText);
+ /**
+ * Returns the command result based on the given PDA response. This command
+ * uses the class type parameter as the return type to allow the compiler to
+ * enforce the correct command result. This class must be implemented by
+ * each command to create the concrete result type.
+ */
+ abstract public PDACommandResult createResult(String resultText);
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java
index 6b0ff76d4..9e8977111 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java
@@ -22,9 +22,9 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDACommandResult {
- final public String fResponseText;
+ final public String fResponseText;
- public PDACommandResult(String response) {
- fResponseText = response;
- }
+ public PDACommandResult(String response) {
+ fResponseText = response;
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java
index 5742e4bdd..326eed9cc 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java
@@ -29,12 +29,12 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDADataCommand extends PDACommand {
- public PDADataCommand(int threadId) {
- super("data " + threadId); //$NON-NLS-1$
- }
+ public PDADataCommand(int threadId) {
+ super("data " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDAListResult(resultText);
- }
+ return new PDAListResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java
index 2ff3fc140..e768055cb 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java
@@ -38,12 +38,12 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDADropFrameCommand extends PDACommand {
- public PDADropFrameCommand(int threadId) {
- super("drop " + threadId); //$NON-NLS-1$
- }
+ public PDADropFrameCommand(int threadId) {
+ super("drop " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java
index b0d019574..7307b709c 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java
@@ -37,12 +37,12 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAEvalCommand extends PDACommand {
- public PDAEvalCommand(int threadId, String operation) {
- super("eval " + threadId + " " + operation); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ public PDAEvalCommand(int threadId, String operation) {
+ super("eval " + threadId + " " + operation); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java
index c3d27287b..b5ffe03fa 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java
@@ -23,14 +23,14 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAEvalResultEvent extends PDAEvent {
- public final String fResult;
+ public final String fResult;
- public PDAEvalResultEvent(String message) {
- super(message);
- fResult = message.substring(getName(message).length() + 1);
- }
+ public PDAEvalResultEvent(String message) {
+ super(message);
+ fResult = message.substring(getName(message).length() + 1);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("evalresult"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("evalresult"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java
index c65642e2c..484339209 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java
@@ -17,62 +17,62 @@ package org.eclipse.debug.examples.core.pda.protocol;
* Base class for PDA events.
*/
public class PDAEvent {
- public final String fMessage;
- public final String fName;
+ public final String fMessage;
+ public final String fName;
- public PDAEvent(String message) {
- fMessage = message;
- fName = getName(message);
- }
+ public PDAEvent(String message) {
+ fMessage = message;
+ fName = getName(message);
+ }
- protected String getName(String message) {
- int nameEnd = message.indexOf(' ');
- nameEnd = nameEnd == -1 ? message.length() : nameEnd;
- return message.substring(0, nameEnd);
- }
+ protected String getName(String message) {
+ int nameEnd = message.indexOf(' ');
+ nameEnd = nameEnd == -1 ? message.length() : nameEnd;
+ return message.substring(0, nameEnd);
+ }
- public static PDAEvent parseEvent(String message) {
- if (PDAEvalResultEvent.isEventMessage(message)) {
- return new PDAEvalResultEvent(message);
- }
- else if (PDAExitedEvent.isEventMessage(message)) {
- return new PDAExitedEvent(message);
- }
- else if (PDANoSuchLabelEvent.isEventMessage(message)) {
- return new PDANoSuchLabelEvent(message);
- }
- else if (PDARegistersEvent.isEventMessage(message)) {
- return new PDARegistersEvent(message);
- }
- else if (PDAResumedEvent.isEventMessage(message)) {
- return new PDAResumedEvent(message);
- }
- else if (PDAStartedEvent.isEventMessage(message)) {
- return new PDAStartedEvent(message);
- }
- else if (PDASuspendedEvent.isEventMessage(message)) {
- return new PDASuspendedEvent(message);
- }
- else if (PDATerminatedEvent.isEventMessage(message)) {
- return new PDATerminatedEvent(message);
- }
- else if (PDAUnimplementedInstructionEvent.isEventMessage(message)) {
- return new PDAUnimplementedInstructionEvent(message);
- }
- else if (PDAVMResumedEvent.isEventMessage(message)) {
- return new PDAVMResumedEvent(message);
- }
- else if (PDAVMStartedEvent.isEventMessage(message)) {
- return new PDAVMStartedEvent(message);
- }
- else if (PDAVMSuspendedEvent.isEventMessage(message)) {
- return new PDAVMSuspendedEvent(message);
- }
- else if (PDAExitedEvent.isEventMessage(message)) {
- return new PDAExitedEvent(message);
- }
- else {
- return new PDAEvent(message);
- }
- }
+ public static PDAEvent parseEvent(String message) {
+ if (PDAEvalResultEvent.isEventMessage(message)) {
+ return new PDAEvalResultEvent(message);
+ }
+ else if (PDAExitedEvent.isEventMessage(message)) {
+ return new PDAExitedEvent(message);
+ }
+ else if (PDANoSuchLabelEvent.isEventMessage(message)) {
+ return new PDANoSuchLabelEvent(message);
+ }
+ else if (PDARegistersEvent.isEventMessage(message)) {
+ return new PDARegistersEvent(message);
+ }
+ else if (PDAResumedEvent.isEventMessage(message)) {
+ return new PDAResumedEvent(message);
+ }
+ else if (PDAStartedEvent.isEventMessage(message)) {
+ return new PDAStartedEvent(message);
+ }
+ else if (PDASuspendedEvent.isEventMessage(message)) {
+ return new PDASuspendedEvent(message);
+ }
+ else if (PDATerminatedEvent.isEventMessage(message)) {
+ return new PDATerminatedEvent(message);
+ }
+ else if (PDAUnimplementedInstructionEvent.isEventMessage(message)) {
+ return new PDAUnimplementedInstructionEvent(message);
+ }
+ else if (PDAVMResumedEvent.isEventMessage(message)) {
+ return new PDAVMResumedEvent(message);
+ }
+ else if (PDAVMStartedEvent.isEventMessage(message)) {
+ return new PDAVMStartedEvent(message);
+ }
+ else if (PDAVMSuspendedEvent.isEventMessage(message)) {
+ return new PDAVMSuspendedEvent(message);
+ }
+ else if (PDAExitedEvent.isEventMessage(message)) {
+ return new PDAExitedEvent(message);
+ }
+ else {
+ return new PDAEvent(message);
+ }
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java
index c89eedd5a..f040a0869 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java
@@ -36,18 +36,18 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAEventStopCommand extends PDACommand {
- public static final int UNIMPINSTR = 0;
- public static final int NOSUCHLABEL = 1;
+ public static final int UNIMPINSTR = 0;
+ public static final int NOSUCHLABEL = 1;
- public PDAEventStopCommand(int event, boolean enable) {
- super("eventstop " + //$NON-NLS-1$
- (event == UNIMPINSTR ? "unimpinstr " : "nosuchlabel ") + //$NON-NLS-1$ //$NON-NLS-2$
- (enable ? "1" : "0")); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ public PDAEventStopCommand(int event, boolean enable) {
+ super("eventstop " + //$NON-NLS-1$
+ (event == UNIMPINSTR ? "unimpinstr " : "nosuchlabel ") + //$NON-NLS-1$ //$NON-NLS-2$
+ (enable ? "1" : "0")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java
index 66ed1e333..eb3c9c696 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java
@@ -23,11 +23,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAExitedEvent extends PDARunControlEvent {
- public PDAExitedEvent(String message) {
- super(message);
- }
+ public PDAExitedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("exited"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("exited"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java
index dc72143ba..22b8e9bee 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java
@@ -29,13 +29,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAFrameCommand extends PDACommand {
- public PDAFrameCommand(int threadId, int frameNum) {
- super("frame " + threadId + " " + frameNum); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ public PDAFrameCommand(int threadId, int frameNum) {
+ super("frame " + threadId + " " + frameNum); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDAFrameCommandResult(resultText);
- }
+ return new PDAFrameCommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java
index 4db761741..48fe4aed2 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java
@@ -21,13 +21,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAFrameCommandResult extends PDACommandResult {
- /**
- * Frame data return by the frame command.
- */
- final public PDAFrameData fFrame;
+ /**
+ * Frame data return by the frame command.
+ */
+ final public PDAFrameData fFrame;
- PDAFrameCommandResult(String response) {
- super(response);
- fFrame = new PDAFrameData(response);
- }
+ PDAFrameCommandResult(String response) {
+ super(response);
+ fFrame = new PDAFrameData(response);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java
index 4aa13dbdc..4ae645796 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java
@@ -29,22 +29,22 @@ import org.eclipse.core.runtime.Path;
public class PDAFrameData {
- final public IPath fFilePath;
- final public int fPC;
- final public String fFunction;
- final public String[] fVariables;
+ final public IPath fFilePath;
+ final public int fPC;
+ final public String fFunction;
+ final public String[] fVariables;
- PDAFrameData(String frameString) {
- StringTokenizer st = new StringTokenizer(frameString, "|"); //$NON-NLS-1$
+ PDAFrameData(String frameString) {
+ StringTokenizer st = new StringTokenizer(frameString, "|"); //$NON-NLS-1$
- fFilePath = new Path(st.nextToken());
- fPC = Integer.parseInt(st.nextToken());
- fFunction = st.nextToken();
+ fFilePath = new Path(st.nextToken());
+ fPC = Integer.parseInt(st.nextToken());
+ fFunction = st.nextToken();
List<String> variablesList = new ArrayList<>();
- while (st.hasMoreTokens()) {
- variablesList.add(st.nextToken());
- }
- fVariables = variablesList.toArray(new String[variablesList.size()]);
- }
+ while (st.hasMoreTokens()) {
+ variablesList.add(st.nextToken());
+ }
+ fVariables = variablesList.toArray(new String[variablesList.size()]);
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java
index 9ff5b3425..f5a3b606c 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java
@@ -26,13 +26,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAGroupsCommand extends PDACommand {
- public PDAGroupsCommand() {
- super("groups"); //$NON-NLS-1$
- }
+ public PDAGroupsCommand() {
+ super("groups"); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDAListResult(resultText);
- }
+ return new PDAListResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java
index 67d3ab73c..11c5092be 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java
@@ -25,23 +25,23 @@ import java.util.StringTokenizer;
public class PDAListResult extends PDACommandResult {
- final public String[] fValues;
+ final public String[] fValues;
- PDAListResult(String response) {
- super(response);
- StringTokenizer st = new StringTokenizer(response, "|"); //$NON-NLS-1$
+ PDAListResult(String response) {
+ super(response);
+ StringTokenizer st = new StringTokenizer(response, "|"); //$NON-NLS-1$
List<String> valuesList = new ArrayList<>();
- while (st.hasMoreTokens()) {
- String token = st.nextToken();
- if (token.length() != 0) {
- valuesList.add(token);
- }
- }
-
- fValues = new String[valuesList.size()];
- for (int i = 0; i < valuesList.size(); i++) {
- fValues[i] = valuesList.get(i);
- }
- }
+ while (st.hasMoreTokens()) {
+ String token = st.nextToken();
+ if (token.length() != 0) {
+ valuesList.add(token);
+ }
+ }
+
+ fValues = new String[valuesList.size()];
+ for (int i = 0; i < valuesList.size(); i++) {
+ fValues[i] = valuesList.get(i);
+ }
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java
index 5d14047e6..48748cd3c 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java
@@ -24,22 +24,22 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDANoSuchLabelEvent extends PDAEvent {
- public final String fLabel;
+ public final String fLabel;
- public PDANoSuchLabelEvent(String message) {
- super(message);
- fLabel = message.substring(getName(message).length() + 1);
- }
+ public PDANoSuchLabelEvent(String message) {
+ super(message);
+ fLabel = message.substring(getName(message).length() + 1);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("no such label"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("no such label"); //$NON-NLS-1$
+ }
- @Override
+ @Override
protected String getName(String message) {
- if (isEventMessage(message)) {
- return "no such label"; //$NON-NLS-1$
- }
- throw new IllegalArgumentException("Invalid event: " + message); //$NON-NLS-1$
- }
+ if (isEventMessage(message)) {
+ return "no such label"; //$NON-NLS-1$
+ }
+ throw new IllegalArgumentException("Invalid event: " + message); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java
index 56f7c78fd..e719a19cd 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java
@@ -28,12 +28,12 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAPopDataCommand extends PDACommand {
- public PDAPopDataCommand(int threadId) {
- super("popdata " + threadId); //$NON-NLS-1$
- }
+ public PDAPopDataCommand(int threadId) {
+ super("popdata " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java
index 8c54a975d..6045881e4 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java
@@ -29,13 +29,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAPushDataCommand extends PDACommand {
- public PDAPushDataCommand(int threadId, String value) {
- super("pushdata " + threadId + " " + value); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ public PDAPushDataCommand(int threadId, String value) {
+ super("pushdata " + threadId + " " + value); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java
index c8fa66162..e071d4768 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java
@@ -26,22 +26,22 @@ import java.util.StringTokenizer;
public class PDARegisterData {
- final public String fName;
- final public boolean fWritable;
- final public PDABitFieldData[] fBitFields;
+ final public String fName;
+ final public boolean fWritable;
+ final public PDABitFieldData[] fBitFields;
- PDARegisterData(String regString) {
- StringTokenizer st = new StringTokenizer(regString, "|"); //$NON-NLS-1$
+ PDARegisterData(String regString) {
+ StringTokenizer st = new StringTokenizer(regString, "|"); //$NON-NLS-1$
- String regInfo = st.nextToken();
- StringTokenizer regSt = new StringTokenizer(regInfo, " "); //$NON-NLS-1$
- fName = regSt.nextToken();
- fWritable = Boolean.getBoolean(regSt.nextToken());
+ String regInfo = st.nextToken();
+ StringTokenizer regSt = new StringTokenizer(regInfo, " "); //$NON-NLS-1$
+ fName = regSt.nextToken();
+ fWritable = Boolean.getBoolean(regSt.nextToken());
List<PDABitFieldData> bitFieldsList = new ArrayList<>();
- while (st.hasMoreTokens()) {
- bitFieldsList.add(new PDABitFieldData(st.nextToken()));
- }
- fBitFields = bitFieldsList.toArray(new PDABitFieldData[bitFieldsList.size()]);
- }
+ while (st.hasMoreTokens()) {
+ bitFieldsList.add(new PDABitFieldData(st.nextToken()));
+ }
+ fBitFields = bitFieldsList.toArray(new PDABitFieldData[bitFieldsList.size()]);
+ }
} \ No newline at end of file
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java
index 19ff4a04b..94a094305 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java
@@ -26,13 +26,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDARegistersCommand extends PDACommand {
- public PDARegistersCommand(String group) {
- super("registers " + group); //$NON-NLS-1$
- }
+ public PDARegistersCommand(String group) {
+ super("registers " + group); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDARegistersCommandResult(resultText);
- }
+ return new PDARegistersCommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java
index e0b5bbbbb..ff092ecc7 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java
@@ -25,19 +25,19 @@ import java.util.StringTokenizer;
public class PDARegistersCommandResult extends PDACommandResult {
- /**
- * Array of registers returned by the registers commands.
- */
- final public PDARegisterData[] fRegisters;
+ /**
+ * Array of registers returned by the registers commands.
+ */
+ final public PDARegisterData[] fRegisters;
- PDARegistersCommandResult(String response) {
- super(response);
- StringTokenizer st = new StringTokenizer(response, "#"); //$NON-NLS-1$
+ PDARegistersCommandResult(String response) {
+ super(response);
+ StringTokenizer st = new StringTokenizer(response, "#"); //$NON-NLS-1$
List<PDARegisterData> regList = new ArrayList<>();
- while (st.hasMoreTokens()) {
- regList.add(new PDARegisterData(st.nextToken()));
- }
- fRegisters = regList.toArray(new PDARegisterData[regList.size()]);
- }
+ while (st.hasMoreTokens()) {
+ regList.add(new PDARegisterData(st.nextToken()));
+ }
+ fRegisters = regList.toArray(new PDARegisterData[regList.size()]);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java
index 9be258251..a0a4a7486 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java
@@ -24,11 +24,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDARegistersEvent extends PDAEvent {
- public PDARegistersEvent(String message) {
- super(message);
- }
+ public PDARegistersEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("registers"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("registers"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java
index 448aa89db..75c766345 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java
@@ -28,13 +28,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDARestartCommand extends PDACommand {
- public PDARestartCommand() {
- super("restart"); //$NON-NLS-1$
- }
+ public PDARestartCommand() {
+ super("restart"); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java
index be6b1660f..d0be2eb9f 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java
@@ -33,13 +33,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAResumeCommand extends PDACommand {
- public PDAResumeCommand(int threadId) {
- super("resume " + threadId); //$NON-NLS-1$
- }
+ public PDAResumeCommand(int threadId) {
+ super("resume " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java
index bea022c9d..29b95ed53 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java
@@ -23,11 +23,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAResumedEvent extends PDARunControlEvent {
- public PDAResumedEvent(String message) {
- super(message);
- }
+ public PDAResumedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("resumed"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("resumed"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java
index dc99a8fee..c98e75257 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java
@@ -20,55 +20,55 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDARunControlEvent extends PDAEvent {
- public final int fThreadId;
- public final String fReason;
+ public final int fThreadId;
+ public final String fReason;
- public PDARunControlEvent(String message) {
- super(message);
- fThreadId = getThreadId(message);
- fReason = getStateChangeReason(message);
- }
+ public PDARunControlEvent(String message) {
+ super(message);
+ fThreadId = getThreadId(message);
+ fReason = getStateChangeReason(message);
+ }
- protected int getThreadId(String message) {
- int nameEnd = getName(message).length();
- if ( Character.isDigit(message.charAt(nameEnd + 1)) ) {
- int threadIdEnd = message.indexOf(' ', nameEnd + 1);
- threadIdEnd = threadIdEnd == -1 ? message.length() : threadIdEnd;
- try {
- return Integer.parseInt(message.substring(nameEnd + 1, threadIdEnd));
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("Invalid event: " + message); //$NON-NLS-1$
- }
- } else {
- return -1;
- }
- }
+ protected int getThreadId(String message) {
+ int nameEnd = getName(message).length();
+ if ( Character.isDigit(message.charAt(nameEnd + 1)) ) {
+ int threadIdEnd = message.indexOf(' ', nameEnd + 1);
+ threadIdEnd = threadIdEnd == -1 ? message.length() : threadIdEnd;
+ try {
+ return Integer.parseInt(message.substring(nameEnd + 1, threadIdEnd));
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("Invalid event: " + message); //$NON-NLS-1$
+ }
+ } else {
+ return -1;
+ }
+ }
- protected String getStateChangeReason(String message) {
- int idx = getName(message).length();
- if ( Character.isDigit(message.charAt(idx + 1)) ) {
- idx = message.indexOf(' ', idx + 1);
- idx = idx == -1 ? message.length() : idx + 1;
- } else {
- idx++;
- }
- if (idx >= message.length()) {
- return ""; //$NON-NLS-1$
- }
+ protected String getStateChangeReason(String message) {
+ int idx = getName(message).length();
+ if ( Character.isDigit(message.charAt(idx + 1)) ) {
+ idx = message.indexOf(' ', idx + 1);
+ idx = idx == -1 ? message.length() : idx + 1;
+ } else {
+ idx++;
+ }
+ if (idx >= message.length()) {
+ return ""; //$NON-NLS-1$
+ }
- int endIdx = message.indexOf(' ', idx);
- endIdx = endIdx == -1 ? message.length() : endIdx;
- return message.substring(idx, endIdx);
- }
+ int endIdx = message.indexOf(' ', idx);
+ endIdx = endIdx == -1 ? message.length() : endIdx;
+ return message.substring(idx, endIdx);
+ }
- @Override
+ @Override
protected String getName(String message) {
- int nameEnd = message.indexOf(' ');
- nameEnd = nameEnd == -1 ? message.length() : nameEnd;
- return message.substring(0, nameEnd);
- }
+ int nameEnd = message.indexOf(' ');
+ nameEnd = nameEnd == -1 ? message.length() : nameEnd;
+ return message.substring(0, nameEnd);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("started"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("started"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java
index df8e6e44f..54706916b 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java
@@ -37,15 +37,15 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDASetBreakpointCommand extends PDACommand {
- public PDASetBreakpointCommand(int line, boolean stopVM) {
- super("set " + //$NON-NLS-1$
- line + " " + //$NON-NLS-1$
- (stopVM ? "1" : "0")); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ public PDASetBreakpointCommand(int line, boolean stopVM) {
+ super("set " + //$NON-NLS-1$
+ line + " " + //$NON-NLS-1$
+ (stopVM ? "1" : "0")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java
index 2273a4456..2a30eb7b2 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java
@@ -29,13 +29,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDASetDataCommand extends PDACommand {
- public PDASetDataCommand(int threadId, int index, String value) {
- super("setdata " + threadId + " " + index + " " + value); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
+ public PDASetDataCommand(int threadId, int index, String value) {
+ super("setdata " + threadId + " " + index + " " + value); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java
index 504fbda4b..a813906cb 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java
@@ -31,13 +31,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDASetVarCommand extends PDACommand {
- public PDASetVarCommand(int threadId, int frame, String variable, String value) {
- super("setvar " + threadId + " " + frame + " " + variable + " " + value); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
+ public PDASetVarCommand(int threadId, int frame, String variable, String value) {
+ super("setvar " + threadId + " " + frame + " " + variable + " " + value); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java
index 2a3300a6f..6c4206551 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java
@@ -32,13 +32,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAStackCommand extends PDACommand {
- public PDAStackCommand(int threadId) {
- super("stack " + threadId); //$NON-NLS-1$
- }
+ public PDAStackCommand(int threadId) {
+ super("stack " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDAStackCommandResult(resultText);
- }
+ return new PDAStackCommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java
index be6db7343..9a1774603 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java
@@ -25,20 +25,20 @@ import java.util.StringTokenizer;
public class PDAStackCommandResult extends PDACommandResult {
- /**
- * Array of frames return by the stack commands. The frames are ordered
- * with the highest-level frame first.
- */
- final public PDAFrameData[] fFrames;
+ /**
+ * Array of frames return by the stack commands. The frames are ordered
+ * with the highest-level frame first.
+ */
+ final public PDAFrameData[] fFrames;
- PDAStackCommandResult(String response) {
- super(response);
- StringTokenizer st = new StringTokenizer(response, "#"); //$NON-NLS-1$
+ PDAStackCommandResult(String response) {
+ super(response);
+ StringTokenizer st = new StringTokenizer(response, "#"); //$NON-NLS-1$
List<PDAFrameData> framesList = new ArrayList<>();
- while (st.hasMoreTokens()) {
- framesList.add(new PDAFrameData(st.nextToken()));
- }
- fFrames = framesList.toArray(new PDAFrameData[framesList.size()]);
- }
+ while (st.hasMoreTokens()) {
+ framesList.add(new PDAFrameData(st.nextToken()));
+ }
+ fFrames = framesList.toArray(new PDAFrameData[framesList.size()]);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java
index 2a6f777e5..53a00a699 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java
@@ -29,13 +29,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAStackDepthCommand extends PDACommand {
- public PDAStackDepthCommand(int threadId) {
- super("stackdepth " + threadId); //$NON-NLS-1$
- }
+ public PDAStackDepthCommand(int threadId) {
+ super("stackdepth " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDAStackDepthCommandResult(resultText);
- }
+ return new PDAStackDepthCommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java
index 9688c76a7..267d7d466 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java
@@ -21,14 +21,14 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAStackDepthCommandResult extends PDACommandResult {
- final public int fDepth;
+ final public int fDepth;
- PDAStackDepthCommandResult(String response) {
- super(response);
- int depth = 1; // default to something that won't cause NPEs
- try {
- depth = Integer.parseInt(response);
- } catch (NumberFormatException e) {}
- fDepth = depth;
- }
+ PDAStackDepthCommandResult(String response) {
+ super(response);
+ int depth = 1; // default to something that won't cause NPEs
+ try {
+ depth = Integer.parseInt(response);
+ } catch (NumberFormatException e) {}
+ fDepth = depth;
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java
index 993785c76..1fa2402df 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java
@@ -24,11 +24,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAStartedEvent extends PDARunControlEvent {
- public PDAStartedEvent(String message) {
- super(message);
- }
+ public PDAStartedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("started"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("started"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java
index 071128324..947cbe899 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java
@@ -38,13 +38,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAStepCommand extends PDACommand {
- public PDAStepCommand(int threadId) {
- super("step " + threadId); //$NON-NLS-1$
- }
+ public PDAStepCommand(int threadId) {
+ super("step " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java
index 3b4f5c775..a927178b4 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java
@@ -39,13 +39,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAStepReturnCommand extends PDACommand {
- public PDAStepReturnCommand(int threadId) {
- super("stepreturn " + threadId); //$NON-NLS-1$
- }
+ public PDAStepReturnCommand(int threadId) {
+ super("stepreturn " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java
index 85502dac8..1059e7240 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java
@@ -33,13 +33,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDASuspendCommand extends PDACommand {
- public PDASuspendCommand(int threadId) {
- super("suspend " + threadId); //$NON-NLS-1$
- }
+ public PDASuspendCommand(int threadId) {
+ super("suspend " + threadId); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java
index 18c99af38..575515132 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java
@@ -37,11 +37,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDASuspendedEvent extends PDARunControlEvent {
- public PDASuspendedEvent(String message) {
- super(message);
- }
+ public PDASuspendedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("suspended"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("suspended"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java
index 542e86512..7e18f5e7c 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java
@@ -27,13 +27,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDATerminateCommand extends PDACommand {
- public PDATerminateCommand() {
- super("terminate"); //$NON-NLS-1$
- }
+ public PDATerminateCommand() {
+ super("terminate"); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java
index 52d92a569..d9b5831f1 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java
@@ -23,11 +23,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDATerminatedEvent extends PDAEvent {
- public PDATerminatedEvent(String message) {
- super(message);
- }
+ public PDATerminatedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("terminated"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("terminated"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java
index 645348415..16ec91c05 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java
@@ -25,22 +25,22 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAUnimplementedInstructionEvent extends PDAEvent {
- public final String fOperation;
+ public final String fOperation;
- public PDAUnimplementedInstructionEvent(String message) {
- super(message);
- fOperation = message.substring(getName(message).length() + 1);
- }
+ public PDAUnimplementedInstructionEvent(String message) {
+ super(message);
+ fOperation = message.substring(getName(message).length() + 1);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("unimplemented instruction"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("unimplemented instruction"); //$NON-NLS-1$
+ }
- @Override
+ @Override
protected String getName(String message) {
- if (isEventMessage(message)) {
- return "unimplemented instruction"; //$NON-NLS-1$
- }
- throw new IllegalArgumentException("Invalid event: " + message); //$NON-NLS-1$
- }
+ if (isEventMessage(message)) {
+ return "unimplemented instruction"; //$NON-NLS-1$
+ }
+ throw new IllegalArgumentException("Invalid event: " + message); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java
index cfd3d5b9d..13e8b182f 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java
@@ -30,13 +30,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAVMResumeCommand extends PDACommand {
- public PDAVMResumeCommand() {
- super("vmresume"); //$NON-NLS-1$
- }
+ public PDAVMResumeCommand() {
+ super("vmresume"); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java
index 752254edd..ae927989e 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java
@@ -30,11 +30,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAVMResumedEvent extends PDARunControlEvent {
- public PDAVMResumedEvent(String message) {
- super(message);
- }
+ public PDAVMResumedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("vmresumed"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("vmresumed"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java
index b784bff87..dd9747aa6 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java
@@ -24,11 +24,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAVMStartedEvent extends PDAEvent {
- public PDAVMStartedEvent(String message) {
- super(message);
- }
+ public PDAVMStartedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("vmstarted"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("vmstarted"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java
index bfbc90863..75304a55b 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java
@@ -30,13 +30,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAVMSuspendCommand extends PDACommand {
- public PDAVMSuspendCommand() {
- super("vmsuspend"); //$NON-NLS-1$
- }
+ public PDAVMSuspendCommand() {
+ super("vmsuspend"); //$NON-NLS-1$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java
index 96ca3ec5d..df7860fb6 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java
@@ -38,11 +38,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAVMSuspendedEvent extends PDARunControlEvent {
- public PDAVMSuspendedEvent(String message) {
- super(message);
- }
+ public PDAVMSuspendedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("vmsuspended"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("vmsuspended"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java
index fcbe52580..63ade7796 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java
@@ -22,11 +22,11 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAVMTerminatedEvent extends PDAEvent {
- public PDAVMTerminatedEvent(String message) {
- super(message);
- }
+ public PDAVMTerminatedEvent(String message) {
+ super(message);
+ }
- public static boolean isEventMessage(String message) {
- return message.startsWith("vmterminated"); //$NON-NLS-1$
- }
+ public static boolean isEventMessage(String message) {
+ return message.startsWith("vmterminated"); //$NON-NLS-1$
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java
index f39347a33..91e07a0ec 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java
@@ -32,13 +32,13 @@ package org.eclipse.debug.examples.core.pda.protocol;
public class PDAVarCommand extends PDACommand {
- public PDAVarCommand(int threadId, int frameId, String name) {
- super("var " + threadId + " " + frameId + " " + name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
+ public PDAVarCommand(int threadId, int frameId, String name) {
+ super("var " + threadId + " " + frameId + " " + name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java
index a681e873e..64ebbb300 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java
@@ -31,18 +31,18 @@ package org.eclipse.debug.examples.core.pda.protocol;
*/
public class PDAWatchCommand extends PDACommand {
- public static final int READ = 1;
- public static final int WRITE = 2;
- public static final int BOTH = READ | WRITE;
- public static final int NONE = 0;
+ public static final int READ = 1;
+ public static final int WRITE = 2;
+ public static final int BOTH = READ | WRITE;
+ public static final int NONE = 0;
- public PDAWatchCommand(String function, String variable, int operation) {
- super("watch " + function+ "::" + variable + " " + operation); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
+ public PDAWatchCommand(String function, String variable, int operation) {
+ super("watch " + function+ "::" + variable + " " + operation); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
- @Override
+ @Override
public PDACommandResult createResult(String resultText) {
- return new PDACommandResult(resultText);
- }
+ return new PDACommandResult(resultText);
+ }
}
diff --git a/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java b/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java
index 2bb17d2af..1a600ca28 100644
--- a/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java
+++ b/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java
@@ -73,25 +73,25 @@ public class PreProcessor extends Task {
public PreProcessor() {
}
- /**
- * Adds a set of files to process.
- *
- * @param set a set of files to process
- */
- public void addFileset(FileSet set) {
- fFileSets.addElement(set);
- }
+ /**
+ * Adds a set of files to process.
+ *
+ * @param set a set of files to process
+ */
+ public void addFileset(FileSet set) {
+ fFileSets.addElement(set);
+ }
- /**
- * Sets the destination directory for processed files.
- *
- * @param destDir destination directory for processed files
- */
- public void setDestdir(File destDir) {
- fDestDir = destDir;
- }
+ /**
+ * Sets the destination directory for processed files.
+ *
+ * @param destDir destination directory for processed files
+ */
+ public void setDestdir(File destDir) {
+ fDestDir = destDir;
+ }
- /**
+ /**
* Sets the symbols that are "on" for the preprocessing.
*
* @param symbols symbols that are "on" for the preprocessing
@@ -283,7 +283,7 @@ public class PreProcessor extends Task {
}
}
- public static void main(String[] args) {
+ public static void main(String[] args) {
PreProcessor processor = new PreProcessor();
processor.setSymbols("ex2"); //$NON-NLS-1$
String string = processor.preProcessFile(new File("c:\\eclipse3.1\\dev\\example.debug.core\\src\\example\\debug\\core\\launcher\\PDALaunchDelegate.java"), "//#"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java
index e50d90bf9..664ab17ca 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java
@@ -49,15 +49,15 @@ public class ControlCellModifier implements ICellModifier {
@Override
public void modify(Object element, String property, Object value) {
Object oldValue = getValue(element, property);
- if (!value.equals(oldValue)) {
- if (SequencerColumnPresentation.COL_VALUE.equals(property)) {
+ if (!value.equals(oldValue)) {
+ if (SequencerColumnPresentation.COL_VALUE.equals(property)) {
if (element instanceof SequencerControl) {
if (value instanceof String) {
SequencerControl control = (SequencerControl) element;
control.setValue((String) value);
}
}
- }
+ }
}
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java
index be482366d..66d18e20a 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java
@@ -47,10 +47,10 @@ public class DebugUIPlugin extends AbstractUIPlugin {
private final static String ICONS_PATH = "icons/full/";//$NON-NLS-1$
private final static String PATH_OBJECT = ICONS_PATH + "obj16/"; //Model object icons //$NON-NLS-1$
- private final static String PATH_ELOCALTOOL = ICONS_PATH + "elcl16/"; //Enabled local toolbar icons //$NON-NLS-1$
- private final static String PATH_DLOCALTOOL = ICONS_PATH + "dlcl16/"; //Disabled local toolbar icons //$NON-NLS-1$
+ private final static String PATH_ELOCALTOOL = ICONS_PATH + "elcl16/"; //Enabled local toolbar icons //$NON-NLS-1$
+ private final static String PATH_DLOCALTOOL = ICONS_PATH + "dlcl16/"; //Disabled local toolbar icons //$NON-NLS-1$
- /**
+ /**
* The id of the plugin
*
* @since 1.4.200
@@ -62,31 +62,31 @@ public class DebugUIPlugin extends AbstractUIPlugin {
public final static String IMG_ELCL_POP = "IMG_ELCL_POP"; //$NON-NLS-1$
public final static String IMG_DLCL_POP = "IMG_DLCL_POP"; //$NON-NLS-1$
- /**
- * Toolbar action to push onto data stack
- */
+ /**
+ * Toolbar action to push onto data stack
+ */
public final static String IMG_ELCL_PUSH = "IMG_ELCL_PUSH"; //$NON-NLS-1$
public final static String IMG_DLCL_PUSH = "IMG_DLCL_PUSH"; //$NON-NLS-1$
- /**
- * PDA program image
- */
+ /**
+ * PDA program image
+ */
public final static String IMG_OBJ_PDA = "IMB_OBJ_PDA"; //$NON-NLS-1$
- /**
- * MIDI file image
- */
+ /**
+ * MIDI file image
+ */
public final static String IMG_OBJ_MIDI = "IMB_OBJ_MIDI"; //$NON-NLS-1$
- /**
- * Keyword color
- */
- public final static RGB KEYWORD = new RGB(0,0,255);
- public final static RGB LABEL = new RGB(128, 128, 0);
+ /**
+ * Keyword color
+ */
+ public final static RGB KEYWORD = new RGB(0,0,255);
+ public final static RGB LABEL = new RGB(128, 128, 0);
- /**
- * Managed colors
- */
+ /**
+ * Managed colors
+ */
private final Map<RGB, Color> fColors = new HashMap<>();
/**
@@ -118,10 +118,10 @@ public class DebugUIPlugin extends AbstractUIPlugin {
plugin = null;
resourceBundle = null;
Iterator<Entry<RGB, Color>> colors = fColors.entrySet().iterator();
- while (colors.hasNext()) {
- Entry<RGB, Color> entry = colors.next();
- entry.getValue().dispose();
- }
+ while (colors.hasNext()) {
+ Entry<RGB, Color> entry = colors.next();
+ entry.getValue().dispose();
+ }
}
/**
@@ -169,17 +169,17 @@ public class DebugUIPlugin extends AbstractUIPlugin {
declareImage(IMG_DLCL_PUSH, PATH_DLOCALTOOL + "push.gif"); //$NON-NLS-1$
}
- /**
- * Declares a workbench image given the path of the image file (relative to
- * the workbench plug-in). This is a helper method that creates the image
- * descriptor and passes it to the main <code>declareImage</code> method.
- *
- * @param symbolicName the symbolic name of the image
- * @param path the path of the image file relative to the base of the workbench
- * plug-ins install directory
- * <code>false</code> if this is not a shared image
- */
- private void declareImage(String key, String path) {
+ /**
+ * Declares a workbench image given the path of the image file (relative to
+ * the workbench plug-in). This is a helper method that creates the image
+ * descriptor and passes it to the main <code>declareImage</code> method.
+ *
+ * @param symbolicName the symbolic name of the image
+ * @param path the path of the image file relative to the base of the workbench
+ * plug-ins install directory
+ * <code>false</code> if this is not a shared image
+ */
+ private void declareImage(String key, String path) {
ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
Bundle bundle = Platform.getBundle(PLUGIN_ID);
URL url = null;
@@ -189,23 +189,23 @@ public class DebugUIPlugin extends AbstractUIPlugin {
desc = ImageDescriptor.createFromURL(url);
}
}
- getImageRegistry().put(key, desc);
- }
-
- /**
- * Returns the color described by the given RGB.
- *
- * @param rgb
- * @return color
- */
- public Color getColor(RGB rgb) {
- Color color = fColors.get(rgb);
- if (color == null) {
- color= new Color(Display.getCurrent(), rgb);
- fColors.put(rgb, color);
- }
- return color;
- }
+ getImageRegistry().put(key, desc);
+ }
+
+ /**
+ * Returns the color described by the given RGB.
+ *
+ * @param rgb
+ * @return color
+ */
+ public Color getColor(RGB rgb) {
+ Color color = fColors.get(rgb);
+ if (color == null) {
+ color= new Color(Display.getCurrent(), rgb);
+ fColors.put(rgb, color);
+ }
+ return color;
+ }
/**
* Returns the active workbench window
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
index 4698fa1b7..25a5ebb20 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java
@@ -26,22 +26,22 @@ import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
*/
public class CommandAdapterFactory implements IAdapterFactory {
- private static IRestartHandler fgRestartHandler = new PDARestartDebugCommand();
+ private static IRestartHandler fgRestartHandler = new PDARestartDebugCommand();
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
@Override
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
- if (IRestartHandler.class.equals(adapterType)) {
- if (adaptableObject instanceof PDADebugTarget) {
- return (T) fgRestartHandler;
- }
- }
- return null;
- }
+ if (IRestartHandler.class.equals(adapterType)) {
+ if (adaptableObject instanceof PDADebugTarget) {
+ return (T) fgRestartHandler;
+ }
+ }
+ return null;
+ }
- @Override
+ @Override
public Class<?>[] getAdapterList() {
- return new Class[]{IRestartHandler.class};
- }
+ return new Class[]{IRestartHandler.class};
+ }
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java
index 2a13dce63..6c4b8fcc3 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java
@@ -26,7 +26,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
public class PDADebugTargetContentProvider extends ElementContentProvider {
- @Override
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
PDAThread thread = ((PDADebugTarget) element).getThread(0);
if (thread != null) {
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java
index 1a7ef09ba..86ac85ca9 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java
@@ -27,34 +27,34 @@ import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
*/
public class PDARestartDebugCommand extends AbstractDebugCommand implements IRestartHandler {
- @Override
+ @Override
protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException {
- for (int i = 0; i < targets.length; i++) {
- ((PDADebugTarget)targets[i]).restart();
- monitor.worked(1);
- }
- }
+ for (int i = 0; i < targets.length; i++) {
+ ((PDADebugTarget)targets[i]).restart();
+ monitor.worked(1);
+ }
+ }
- @Override
+ @Override
protected Object getTarget(Object element) {
- IDebugTarget target = (IDebugTarget)getAdapter(element, IDebugTarget.class);
- if (target instanceof PDADebugTarget) {
- return target;
- }
- return null;
- }
+ IDebugTarget target = (IDebugTarget)getAdapter(element, IDebugTarget.class);
+ if (target instanceof PDADebugTarget) {
+ return target;
+ }
+ return null;
+ }
- @Override
+ @Override
protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request)
- throws CoreException
- {
- for (int i = 0; i < targets.length; i++) {
- if (((PDADebugTarget)targets[i]).isTerminated()) {
- return false;
- }
- monitor.worked(1);
- }
- return true;
- }
+ throws CoreException
+ {
+ for (int i = 0; i < targets.length; i++) {
+ if (((PDADebugTarget)targets[i]).isTerminated()) {
+ return false;
+ }
+ monitor.worked(1);
+ }
+ return true;
+ }
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java
index 1e38468de..99d6a2f7c 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java
@@ -46,12 +46,12 @@ public class PDAThreadEventHandler extends DebugEventHandler {
@Override
protected void handleSuspend(DebugEvent event) {
- IThread thread = (IThread) event.getSource();
- int extras = IModelDelta.STATE;
- if (event.getDetail() == DebugEvent.BREAKPOINT | event.getDetail() == DebugEvent.CLIENT_REQUEST) {
- extras = IModelDelta.EXPAND;
- }
- fireDeltaUpdatingTopFrame(thread, IModelDelta.NO_CHANGE | extras);
+ IThread thread = (IThread) event.getSource();
+ int extras = IModelDelta.STATE;
+ if (event.getDetail() == DebugEvent.BREAKPOINT | event.getDetail() == DebugEvent.CLIENT_REQUEST) {
+ extras = IModelDelta.EXPAND;
+ }
+ fireDeltaUpdatingTopFrame(thread, IModelDelta.NO_CHANGE | extras);
}
private boolean isEqual(Object o1, Object o2) {
@@ -135,23 +135,23 @@ public class PDAThreadEventHandler extends DebugEventHandler {
ModelDelta delta = buildRootDelta();
ModelDelta node = addTarget(delta, thread);
synchronized (this) {
- IStackFrame prev = fPrev;
- IStackFrame frame = null;
+ IStackFrame prev = fPrev;
+ IStackFrame frame = null;
try {
frame = thread.getTopStackFrame();
} catch (DebugException e) {
}
- if (isEqual(frame, prev)) {
- node.setFlags(flags);
- } else {
+ if (isEqual(frame, prev)) {
+ node.setFlags(flags);
+ } else {
node.setFlags(flags | IModelDelta.CONTENT);
- }
- if (frame != null) {
- node.addNode(frame, 0, IModelDelta.STATE | IModelDelta.SELECT, 0);
- }
- fPrev = frame;
+ }
+ if (frame != null) {
+ node.addNode(frame, 0, IModelDelta.STATE | IModelDelta.SELECT, 0);
+ }
+ fPrev = frame;
}
- fireDelta(delta);
+ fireDelta(delta);
}
@Override
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java
index 7a7b246a3..3e002de85 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java
@@ -65,69 +65,69 @@ import org.eclipse.ui.texteditor.IUpdate;
*/
public class PDAVirtualFindAction extends Action implements IUpdate {
- private final TreeModelViewer fClientViewer;
+ private final TreeModelViewer fClientViewer;
protected class VirtualViewerListener implements IViewerUpdateListener, ILabelUpdateListener {
- private boolean fViewerUpdatesComplete = false;
- private boolean fLabelUpdatesComplete = false;
- private IProgressMonitor fProgressMonitor;
- private int fRemainingUpdatesCount = 0;
+ private boolean fViewerUpdatesComplete = false;
+ private boolean fLabelUpdatesComplete = false;
+ private IProgressMonitor fProgressMonitor;
+ private int fRemainingUpdatesCount = 0;
- @Override
+ @Override
public void labelUpdateStarted(ILabelUpdate update) {}
- @Override
+ @Override
public void labelUpdateComplete(ILabelUpdate update) {
- incrementProgress(1);
- }
- @Override
+ incrementProgress(1);
+ }
+ @Override
public void labelUpdatesBegin() {
- fLabelUpdatesComplete = false;
- }
- @Override
+ fLabelUpdatesComplete = false;
+ }
+ @Override
public void labelUpdatesComplete() {
- fLabelUpdatesComplete = true;
- completeProgress();
- }
+ fLabelUpdatesComplete = true;
+ completeProgress();
+ }
- @Override
+ @Override
public void updateStarted(IViewerUpdate update) {}
- @Override
+ @Override
public void updateComplete(IViewerUpdate update) {
- if (update instanceof IChildrenUpdate) {
- incrementProgress(((IChildrenUpdate)update).getLength());
- }
- }
- @Override
+ if (update instanceof IChildrenUpdate) {
+ incrementProgress(((IChildrenUpdate)update).getLength());
+ }
+ }
+ @Override
public void viewerUpdatesBegin() {
- fViewerUpdatesComplete = false;
- }
- @Override
+ fViewerUpdatesComplete = false;
+ }
+ @Override
public void viewerUpdatesComplete() {
- fViewerUpdatesComplete = true;
- completeProgress();
- }
-
- private void completeProgress() {
- IProgressMonitor pm;
- synchronized (this) {
- pm = fProgressMonitor;
- }
- if (pm != null && fLabelUpdatesComplete && fViewerUpdatesComplete) {
- pm.done();
- }
- }
-
- private void incrementProgress(int count) {
- IProgressMonitor pm;
- synchronized (this) {
- pm = fProgressMonitor;
- fRemainingUpdatesCount -= count;
- }
- if (pm != null && fLabelUpdatesComplete && fViewerUpdatesComplete) {
- pm.worked(count);
- }
- }
+ fViewerUpdatesComplete = true;
+ completeProgress();
+ }
+
+ private void completeProgress() {
+ IProgressMonitor pm;
+ synchronized (this) {
+ pm = fProgressMonitor;
+ }
+ if (pm != null && fLabelUpdatesComplete && fViewerUpdatesComplete) {
+ pm.done();
+ }
+ }
+
+ private void incrementProgress(int count) {
+ IProgressMonitor pm;
+ synchronized (this) {
+ pm = fProgressMonitor;
+ fRemainingUpdatesCount -= count;
+ }
+ if (pm != null && fLabelUpdatesComplete && fViewerUpdatesComplete) {
+ pm.worked(count);
+ }
+ }
}
@@ -136,21 +136,21 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
private final Map<VirtualItem, String> fTextCache = new HashMap<>();
public FindLabelProvider(VirtualTreeModelViewer viewer, List<VirtualItem> items) {
- fVirtualViewer = viewer;
- for (int i = 0; i < items.size(); i++) {
- VirtualItem item = items.get(i);
- fTextCache.put(item, fVirtualViewer.getText(item, 0));
- }
+ fVirtualViewer = viewer;
+ for (int i = 0; i < items.size(); i++) {
+ VirtualItem item = items.get(i);
+ fTextCache.put(item, fVirtualViewer.getText(item, 0));
+ }
}
@Override
public Image getImage(Object element) {
- return fVirtualViewer.getImage((VirtualItem) element, 0);
+ return fVirtualViewer.getImage((VirtualItem) element, 0);
}
@Override
public String getText(Object element) {
- return fTextCache.get(element);
+ return fTextCache.get(element);
}
}
@@ -159,64 +159,64 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
setId(DebugUIPlugin.getUniqueIdentifier() + ".FindElementAction"); //$NON-NLS-1$
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.FIND_ELEMENT_ACTION);
setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
- fClientViewer = (TreeModelViewer)((IDebugView)context.getPart()).getViewer();
+ fClientViewer = (TreeModelViewer)((IDebugView)context.getPart()).getViewer();
}
protected VirtualTreeModelViewer initVirtualViewer(TreeModelViewer clientViewer, VirtualViewerListener listener) {
- Object input = clientViewer.getInput();
- ModelDelta stateDelta = new ModelDelta(input, IModelDelta.NO_CHANGE);
- clientViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND);
- listener.fRemainingUpdatesCount = calcUpdatesCount(stateDelta);
- VirtualTreeModelViewer fVirtualViewer = new VirtualTreeModelViewer(
- clientViewer.getDisplay(),
- SWT.NONE,
- makeVirtualPresentationContext(clientViewer.getPresentationContext()));
- fVirtualViewer.addViewerUpdateListener(listener);
- fVirtualViewer.addLabelUpdateListener(listener);
- fVirtualViewer.setInput(input);
- if (fVirtualViewer.canToggleColumns()) {
- fVirtualViewer.setShowColumns(clientViewer.isShowColumns());
- }
- fVirtualViewer.updateViewer(stateDelta);
- return fVirtualViewer;
+ Object input = clientViewer.getInput();
+ ModelDelta stateDelta = new ModelDelta(input, IModelDelta.NO_CHANGE);
+ clientViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND);
+ listener.fRemainingUpdatesCount = calcUpdatesCount(stateDelta);
+ VirtualTreeModelViewer fVirtualViewer = new VirtualTreeModelViewer(
+ clientViewer.getDisplay(),
+ SWT.NONE,
+ makeVirtualPresentationContext(clientViewer.getPresentationContext()));
+ fVirtualViewer.addViewerUpdateListener(listener);
+ fVirtualViewer.addLabelUpdateListener(listener);
+ fVirtualViewer.setInput(input);
+ if (fVirtualViewer.canToggleColumns()) {
+ fVirtualViewer.setShowColumns(clientViewer.isShowColumns());
+ }
+ fVirtualViewer.updateViewer(stateDelta);
+ return fVirtualViewer;
}
protected IPresentationContext makeVirtualPresentationContext(final IPresentationContext clientViewerContext) {
- return new PresentationContext(clientViewerContext.getId()) {
+ return new PresentationContext(clientViewerContext.getId()) {
- {
- String[] clientProperties = clientViewerContext.getProperties();
- for (int i = 0; i < clientProperties.length; i++) {
- setProperty(clientProperties[i], clientViewerContext.getProperty(clientProperties[i]));
- }
+ {
+ String[] clientProperties = clientViewerContext.getProperties();
+ for (int i = 0; i < clientProperties.length; i++) {
+ setProperty(clientProperties[i], clientViewerContext.getProperty(clientProperties[i]));
+ }
- }
+ }
- @Override
+ @Override
public String[] getColumns() {
- String[] clientColumns = super.getColumns();
-
- if (clientColumns == null || clientColumns.length == 0) {
- // No columns are used.
- return null;
- }
-
- // Try to find the name column.
- for (int i = 0; i < clientColumns.length; i++) {
- if (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(clientColumns[i])) {
- return new String[] { IDebugUIConstants.COLUMN_ID_VARIABLE_NAME };
- }
- }
-
- return new String[] { clientColumns[0] };
- }
- };
+ String[] clientColumns = super.getColumns();
+
+ if (clientColumns == null || clientColumns.length == 0) {
+ // No columns are used.
+ return null;
+ }
+
+ // Try to find the name column.
+ for (int i = 0; i < clientColumns.length; i++) {
+ if (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(clientColumns[i])) {
+ return new String[] { IDebugUIConstants.COLUMN_ID_VARIABLE_NAME };
+ }
+ }
+
+ return new String[] { clientColumns[0] };
+ }
+ };
}
@Override
public void run() {
- final VirtualViewerListener listener = new VirtualViewerListener();
- VirtualTreeModelViewer virtualViewer = initVirtualViewer(fClientViewer, listener);
+ final VirtualViewerListener listener = new VirtualViewerListener();
+ VirtualTreeModelViewer virtualViewer = initVirtualViewer(fClientViewer, listener);
ProgressMonitorDialog dialog = new TimeTriggeredProgressMonitorDialog(fClientViewer.getControl().getShell(), 500);
final IProgressMonitor monitor = dialog.getProgressMonitor();
@@ -224,23 +224,23 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
try {
dialog.run(
- true, true,
- new IRunnableWithProgress() {
- @Override
+ true, true,
+ new IRunnableWithProgress() {
+ @Override
public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
- synchronized(listener) {
- listener.fProgressMonitor = m;
- listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getText()), listener.fRemainingUpdatesCount);
- }
-
- while ((!listener.fLabelUpdatesComplete || !listener.fViewerUpdatesComplete) && !listener.fProgressMonitor.isCanceled()) {
- Thread.sleep(1);
- }
- synchronized(listener) {
- listener.fProgressMonitor = null;
- }
- }
- });
+ synchronized(listener) {
+ listener.fProgressMonitor = m;
+ listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getText()), listener.fRemainingUpdatesCount);
+ }
+
+ while ((!listener.fLabelUpdatesComplete || !listener.fViewerUpdatesComplete) && !listener.fProgressMonitor.isCanceled()) {
+ Thread.sleep(1);
+ }
+ synchronized(listener) {
+ listener.fProgressMonitor = null;
+ }
+ }
+ });
} catch (InvocationTargetException e) {
DebugUIPlugin.log(e);
return;
@@ -255,30 +255,30 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
FindLabelProvider labelProvider = new FindLabelProvider(virtualViewer, list);
VirtualItem result = performFind(list, labelProvider);
if (result != null) {
- setSelectionToClient(virtualViewer, labelProvider, result);
+ setSelectionToClient(virtualViewer, labelProvider, result);
}
}
- virtualViewer.removeLabelUpdateListener(listener);
- virtualViewer.removeViewerUpdateListener(listener);
- virtualViewer.dispose();
+ virtualViewer.removeLabelUpdateListener(listener);
+ virtualViewer.removeViewerUpdateListener(listener);
+ virtualViewer.dispose();
}
private int calcUpdatesCount(IModelDelta stateDelta) {
- final int[] count = new int[] {0};
- stateDelta.accept( new IModelDeltaVisitor() {
- @Override
+ final int[] count = new int[] {0};
+ stateDelta.accept( new IModelDeltaVisitor() {
+ @Override
public boolean visit(IModelDelta delta, int depth) {
- if ((delta.getFlags() & IModelDelta.EXPAND) != 0) {
- count[0] += delta.getChildCount();
- return true;
- }
- return false;
- }
- });
-
- // Double it to account for separate element and label update ticks.
- return count[0] * 2;
+ if ((delta.getFlags() & IModelDelta.EXPAND) != 0) {
+ count[0] += delta.getChildCount();
+ return true;
+ }
+ return false;
+ }
+ });
+
+ // Double it to account for separate element and label update ticks.
+ return count[0] * 2;
}
private void collectAllChildren(VirtualItem element, List<VirtualItem> collect) {
@@ -295,42 +295,42 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
protected VirtualItem performFind(List<VirtualItem> items, FindLabelProvider labelProvider) {
FindElementDialog dialog = new FindElementDialog(
- fClientViewer.getControl().getShell(),
- labelProvider,
- items.toArray());
+ fClientViewer.getControl().getShell(),
+ labelProvider,
+ items.toArray());
dialog.setTitle("PDA Variables View Find"); //$NON-NLS-1$
dialog.setMessage("&Specify an element to select (? = any character, * = any String):"); //$NON-NLS-1$
if (dialog.open() == Window.OK) {
Object[] elements = dialog.getResult();
if (elements.length == 1) {
- return (VirtualItem)elements[0];
+ return (VirtualItem)elements[0];
}
}
return null;
}
protected void setSelectionToClient(VirtualTreeModelViewer virtualViewer, ILabelProvider labelProvider, VirtualItem findItem) {
- virtualViewer.getTree().setSelection(new VirtualItem[] { findItem } );
- ModelDelta stateDelta = new ModelDelta(virtualViewer.getInput(), IModelDelta.NO_CHANGE);
- virtualViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.SELECT);
- fClientViewer.updateViewer(stateDelta);
-
- ISelection selection = fClientViewer.getSelection();
- if (!selection.isEmpty() &&
- selection instanceof IStructuredSelection &&
- ((IStructuredSelection)selection).getFirstElement().equals(findItem.getData()) ) {
- } else {
- DebugUIPlugin.errorDialog(
- fClientViewer.getControl().getShell(),
+ virtualViewer.getTree().setSelection(new VirtualItem[] { findItem } );
+ ModelDelta stateDelta = new ModelDelta(virtualViewer.getInput(), IModelDelta.NO_CHANGE);
+ virtualViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.SELECT);
+ fClientViewer.updateViewer(stateDelta);
+
+ ISelection selection = fClientViewer.getSelection();
+ if (!selection.isEmpty() &&
+ selection instanceof IStructuredSelection &&
+ ((IStructuredSelection)selection).getFirstElement().equals(findItem.getData()) ) {
+ } else {
+ DebugUIPlugin.errorDialog(
+ fClientViewer.getControl().getShell(),
"Error", //$NON-NLS-1$
"Could not select item:" + labelProvider.getText(findItem), //$NON-NLS-1$
new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), "Element no longer in viewer.")); //$NON-NLS-1$
- }
+ }
}
@Override
public void update() {
- setEnabled( fClientViewer.getInput() != null && fClientViewer.getChildCount(TreePath.EMPTY) > 0 );
+ setEnabled( fClientViewer.getInput() != null && fClientViewer.getChildCount(TreePath.EMPTY) > 0 );
}
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
index fc617622e..3cdfcf5fb 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java
@@ -100,15 +100,15 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
@Override
public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
- String[] variableAndFunctionName = getVariableAndFunctionName(part, selection);
- if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) {
- ITextEditor editorPart = (ITextEditor)part;
- int lineNumber = ((ITextSelection)selection).getStartLine();
- IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
- String var = variableAndFunctionName[0];
- String fcn = variableAndFunctionName[1];
- toggleWatchpoint(resource, lineNumber, fcn, var, true, true);
- }
+ String[] variableAndFunctionName = getVariableAndFunctionName(part, selection);
+ if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) {
+ ITextEditor editorPart = (ITextEditor)part;
+ int lineNumber = ((ITextSelection)selection).getStartLine();
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
+ String var = variableAndFunctionName[0];
+ String fcn = variableAndFunctionName[1];
+ toggleWatchpoint(resource, lineNumber, fcn, var, true, true);
+ }
}
@Override
@@ -117,25 +117,25 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
}
protected void toggleWatchpoint(IResource resource, int lineNumber, String fcn, String var, boolean access,
- boolean modification) throws CoreException
+ boolean modification) throws CoreException
{
- // look for existing watchpoint to delete
- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(DebugCorePlugin.ID_PDA_DEBUG_MODEL);
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- if (breakpoint instanceof PDAWatchpoint && resource.equals(breakpoint.getMarker().getResource())) {
- PDAWatchpoint watchpoint = (PDAWatchpoint)breakpoint;
- String otherVar = watchpoint.getVariableName();
- String otherFcn = watchpoint.getFunctionName();
- if (otherVar.equals(var) && otherFcn.equals(fcn)) {
- breakpoint.delete();
- return;
- }
- }
- }
- // create watchpoint
- PDAWatchpoint watchpoint = new PDAWatchpoint(resource, lineNumber + 1, fcn, var, access, modification);
- DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(watchpoint);
+ // look for existing watchpoint to delete
+ IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(DebugCorePlugin.ID_PDA_DEBUG_MODEL);
+ for (int i = 0; i < breakpoints.length; i++) {
+ IBreakpoint breakpoint = breakpoints[i];
+ if (breakpoint instanceof PDAWatchpoint && resource.equals(breakpoint.getMarker().getResource())) {
+ PDAWatchpoint watchpoint = (PDAWatchpoint)breakpoint;
+ String otherVar = watchpoint.getVariableName();
+ String otherFcn = watchpoint.getFunctionName();
+ if (otherVar.equals(var) && otherFcn.equals(fcn)) {
+ breakpoint.delete();
+ return;
+ }
+ }
+ }
+ // create watchpoint
+ PDAWatchpoint watchpoint = new PDAWatchpoint(resource, lineNumber + 1, fcn, var, access, modification);
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(watchpoint);
}
/**
@@ -147,27 +147,27 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
* The array has two elements, the first is the variable name, the second is the function name.
*/
protected String[] getVariableAndFunctionName(IWorkbenchPart part, ISelection selection) {
- ITextEditor editor = getEditor(part);
- if (editor != null && selection instanceof ITextSelection) {
- ITextSelection textSelection = (ITextSelection) selection;
- IDocumentProvider documentProvider = editor.getDocumentProvider();
- try {
- documentProvider.connect(this);
- IDocument document = documentProvider.getDocument(editor.getEditorInput());
- IRegion region = document.getLineInformationOfOffset(textSelection.getOffset());
- String string = document.get(region.getOffset(), region.getLength()).trim();
+ ITextEditor editor = getEditor(part);
+ if (editor != null && selection instanceof ITextSelection) {
+ ITextSelection textSelection = (ITextSelection) selection;
+ IDocumentProvider documentProvider = editor.getDocumentProvider();
+ try {
+ documentProvider.connect(this);
+ IDocument document = documentProvider.getDocument(editor.getEditorInput());
+ IRegion region = document.getLineInformationOfOffset(textSelection.getOffset());
+ String string = document.get(region.getOffset(), region.getLength()).trim();
if (string.startsWith("var ")) { //$NON-NLS-1$
- String varName = string.substring(4).trim();
- String fcnName = getFunctionName(document, varName, document.getLineOfOffset(textSelection.getOffset()));
- return new String[] {varName, fcnName};
- }
- } catch (CoreException e) {
- } catch (BadLocationException e) {
- } finally {
- documentProvider.disconnect(this);
- }
- }
- return null;
+ String varName = string.substring(4).trim();
+ String fcnName = getFunctionName(document, varName, document.getLineOfOffset(textSelection.getOffset()));
+ return new String[] {varName, fcnName};
+ }
+ } catch (CoreException e) {
+ } catch (BadLocationException e) {
+ } finally {
+ documentProvider.disconnect(this);
+ }
+ }
+ return null;
}
/**
@@ -180,39 +180,39 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
* @return name of function defining the variable
*/
private String getFunctionName(IDocument document, String varName, int line) {
- // This is a simple guess at the function name - look for the labels preceeding
- // the variable definition, and then see if there are any 'calls' to that
- // label. If none, assumet the variable is in the "_main_" function
- String source = document.get();
- int lineIndex = line - 1;
- while (lineIndex >= 0) {
- try {
- IRegion information = document.getLineInformation(lineIndex);
- String lineText = document.get(information.getOffset(), information.getLength());
+ // This is a simple guess at the function name - look for the labels preceeding
+ // the variable definition, and then see if there are any 'calls' to that
+ // label. If none, assumet the variable is in the "_main_" function
+ String source = document.get();
+ int lineIndex = line - 1;
+ while (lineIndex >= 0) {
+ try {
+ IRegion information = document.getLineInformation(lineIndex);
+ String lineText = document.get(information.getOffset(), information.getLength());
if (lineText.startsWith(":")) { //$NON-NLS-1$
- String label = lineText.substring(1);
+ String label = lineText.substring(1);
if (source.contains("call " + label)) { //$NON-NLS-1$
- return label;
- }
- }
- lineIndex--;
- } catch (BadLocationException e) {
- }
- }
+ return label;
+ }
+ }
+ lineIndex--;
+ } catch (BadLocationException e) {
+ }
+ }
return "_main_"; //$NON-NLS-1$
}
- @Override
+ @Override
public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
- if (canToggleWatchpoints(part, selection)) {
- toggleWatchpoints(part, selection);
- } else {
- toggleLineBreakpoints(part, selection);
- }
- }
+ if (canToggleWatchpoints(part, selection)) {
+ toggleWatchpoints(part, selection);
+ } else {
+ toggleLineBreakpoints(part, selection);
+ }
+ }
- @Override
+ @Override
public boolean canToggleBreakpoints(IWorkbenchPart part, ISelection selection) {
- return canToggleLineBreakpoints(part, selection) || canToggleWatchpoints(part, selection);
- }
+ return canToggleLineBreakpoints(part, selection) || canToggleWatchpoints(part, selection);
+ }
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
index 438afa76c..277747887 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java
@@ -35,15 +35,15 @@ public class PDAEditorAdapterFactory implements IAdapterFactory {
if (resource != null) {
String extension = resource.getFileExtension();
if (extension != null && extension.equals("pda")) { //$NON-NLS-1$
- if (adapterType.equals(IToggleBreakpointsTarget.class)) {
+ if (adapterType.equals(IToggleBreakpointsTarget.class)) {
return (T) new PDABreakpointAdapter();
- }
+ }
//#ifdef ex7
//# // TODO: Exercise 7 - create run to line adapter
//#else
if (adapterType.equals(IRunToLineTarget.class)) {
return (T) new PDARunToLineAdapter();
- }
+ }
//#endif
}
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
index 1aef74728..0fe58af12 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java
@@ -42,121 +42,121 @@ import org.eclipse.ui.texteditor.ITextEditor;
*/
public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
- final private boolean fAccessModeEnabled;
- final private boolean fModificationModeEnabled;
+ final private boolean fAccessModeEnabled;
+ final private boolean fModificationModeEnabled;
- PDAToggleWatchpointsTarget(boolean access, boolean modification) {
- fAccessModeEnabled = access;
- fModificationModeEnabled = modification;
- }
+ PDAToggleWatchpointsTarget(boolean access, boolean modification) {
+ fAccessModeEnabled = access;
+ fModificationModeEnabled = modification;
+ }
- @Override
+ @Override
public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
- if (super.canToggleWatchpoints(part, selection)) {
- return true;
- } else {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- return ss.getFirstElement() instanceof PDAVariable;
- }
- }
- return false;
- }
+ if (super.canToggleWatchpoints(part, selection)) {
+ return true;
+ } else {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection)selection;
+ return ss.getFirstElement() instanceof PDAVariable;
+ }
+ }
+ return false;
+ }
@Override
public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
- String[] variableAndFunctionName = getVariableAndFunctionName(part, selection);
-
- if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) {
- // Selection inside text editor. Create a watchpoint based on
- // current source line.
- ITextEditor editorPart = (ITextEditor)part;
- int lineNumber = ((ITextSelection)selection).getStartLine();
- IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
- String var = variableAndFunctionName[0];
- String fcn = variableAndFunctionName[1];
- toggleWatchpoint(resource, lineNumber, fcn, var, fAccessModeEnabled, fModificationModeEnabled);
- } else if (selection instanceof IStructuredSelection &&
- ((IStructuredSelection)selection).getFirstElement() instanceof PDAVariable )
- {
- // Selection is inside a variables view. Create a watchpoint
- // using information from the variable. Retrieving information
- // from the model requires performing source lookup which should be
- // done on a background thread.
- final PDAVariable var = (PDAVariable)((IStructuredSelection)selection).getFirstElement();
- final PDAStackFrame frame = var.getStackFrame();
- final Shell shell = part.getSite().getShell();
+ String[] variableAndFunctionName = getVariableAndFunctionName(part, selection);
+
+ if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) {
+ // Selection inside text editor. Create a watchpoint based on
+ // current source line.
+ ITextEditor editorPart = (ITextEditor)part;
+ int lineNumber = ((ITextSelection)selection).getStartLine();
+ IResource resource = editorPart.getEditorInput().getAdapter(IResource.class);
+ String var = variableAndFunctionName[0];
+ String fcn = variableAndFunctionName[1];
+ toggleWatchpoint(resource, lineNumber, fcn, var, fAccessModeEnabled, fModificationModeEnabled);
+ } else if (selection instanceof IStructuredSelection &&
+ ((IStructuredSelection)selection).getFirstElement() instanceof PDAVariable )
+ {
+ // Selection is inside a variables view. Create a watchpoint
+ // using information from the variable. Retrieving information
+ // from the model requires performing source lookup which should be
+ // done on a background thread.
+ final PDAVariable var = (PDAVariable)((IStructuredSelection)selection).getFirstElement();
+ final PDAStackFrame frame = var.getStackFrame();
+ final Shell shell = part.getSite().getShell();
new Job("Toggle PDA Watchpoint") { //$NON-NLS-1$
- { setSystem(true); }
+ { setSystem(true); }
- @Override
+ @Override
protected IStatus run(IProgressMonitor monitor) {
- try {
- IFile file = getResource(var.getStackFrame());
- String varName = var.getName();
- int line = findLine(file, varName);
- toggleWatchpoint(file, line, frame.getName(), varName,
- fAccessModeEnabled, fModificationModeEnabled);
- } catch (final CoreException e) {
- // Need to switch back to the UI thread to show the error
- // dialog.
+ try {
+ IFile file = getResource(var.getStackFrame());
+ String varName = var.getName();
+ int line = findLine(file, varName);
+ toggleWatchpoint(file, line, frame.getName(), varName,
+ fAccessModeEnabled, fModificationModeEnabled);
+ } catch (final CoreException e) {
+ // Need to switch back to the UI thread to show the error
+ // dialog.
new WorkbenchJob(shell.getDisplay(), "Toggle PDA Watchpoint") { //$NON-NLS-1$
- { setSystem(true); }
+ { setSystem(true); }
- @Override
+ @Override
public IStatus runInUIThread(IProgressMonitor submonitor) {
ErrorDialog.openError(shell, "Failed to create PDA watchpoint", "Failed to create PDA watchpoint.\n", e.getStatus()); //$NON-NLS-1$ //$NON-NLS-2$
- return Status.OK_STATUS;
- }
- }.schedule();
- }
- return Status.OK_STATUS;
- }
- }.schedule();
- }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
}
private IFile getResource(PDAStackFrame frame) {
- ISourceLocator locator = frame.getLaunch().getSourceLocator();
- Object sourceElement = locator.getSourceElement(frame);
- if (sourceElement instanceof IFile) {
- return (IFile)sourceElement;
- }
- return null;
+ ISourceLocator locator = frame.getLaunch().getSourceLocator();
+ Object sourceElement = locator.getSourceElement(frame);
+ if (sourceElement instanceof IFile) {
+ return (IFile)sourceElement;
+ }
+ return null;
}
private int findLine(IFile file, String var) throws CoreException {
- int lineNum = 0;
+ int lineNum = 0;
try (BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()))) {
- while(true) {
- String line = reader.readLine().trim();
+ while(true) {
+ String line = reader.readLine().trim();
if (line.startsWith("var")) { //$NON-NLS-1$
String varName = line.substring("var".length()).trim(); //$NON-NLS-1$
- if (varName.equals(var)) {
- break;
- }
- }
- lineNum++;
- }
- } catch (IOException e) {
- // end of file reached and line wasn't found
- return -1;<