From f88b03fbd00979cb2adf20f2c4c72f44a8dfd2f1 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Mon, 15 Sep 2008 21:31:37 +0000 Subject: [PATCH] [247356] Use API tooling. --- plugins/org.eclipse.dd.dsf.debug.ui/.project | 6 + .../.settings/.api_filters | 395 ++++++++++++++++++ .../META-INF/MANIFEST.MF | 22 +- .../AbstractVMProviderActionDelegate.java | 3 + ...DefaultDsfModelSelectionPolicyFactory.java | 1 + .../launch/DefaultDsfSelectionPolicy.java | 1 + .../register/RegisterBitFieldVMNode.java | 8 +- .../register/RegisterGroupVMNode.java | 3 + .../ui/viewmodel/register/RegisterVMNode.java | 3 + .../update/actions/AllUpdateScopeAction.java | 2 +- .../actions/AtomicUpdatePolicyAction.java | 3 + .../actions/NonAtomicUpdatePolicyAction.java | 3 + .../actions/SelectUpdateScopeAction.java | 2 +- .../actions/VisibleUpdateScopeAction.java | 2 +- .../variable/SyncVariableDataAccess.java | 3 + .../dd/dsf/debug/ui/DsfDebugUITools.java | 3 + .../sourcelookup/DsfSourceDisplayAdapter.java | 3 + plugins/org.eclipse.dd.dsf.debug/.project | 6 + .../AbstractDsfDebugServicesFactory.java | 4 + .../service/IDsfDebugServicesFactory.java | 3 +- .../dd/dsf/debug/service/IProcesses.java | 1 + plugins/org.eclipse.dd.dsf.ui/.project | 6 + .../dsf/ui/viewmodel/AbstractVMProvider.java | 6 + .../DefaultVMModelProxyStrategy.java | 6 +- .../ui/viewmodel/IVMModelProxyExtension.java | 2 + .../viewmodel/datamodel/AbstractDMVMNode.java | 2 + .../update/AbstractCachingVMProvider.java | 23 + .../ui/viewmodel/update/AllUpdateScope.java | 2 + .../ui/viewmodel/update/IVMUpdateScope.java | 4 +- .../update/UpdatePolicyDecorator.java | 2 + .../update/ViewModelUpdateMessages.java | 6 + .../viewmodel/update/VisibleUpdateScope.java | 1 + plugins/org.eclipse.dd.dsf/.project | 6 + .../eclipse/dd/dsf/datamodel/DMContexts.java | 1 + .../dsf/dataviewer/AsyncDataViewer.java | 272 ++++++++++++ .../dataviewer/DataGeneratorWithExecutor.java | 336 +++++++++++++++ .../dataviewer/DataGeneratorWithThread.java | 238 +++++++++++ .../dsf/dataviewer/IDataGenerator.java | 59 +++ .../dsf/dataviewer/SyncDataViewer.java | 183 ++++++++ .../dataviewer/answers/AsyncDataViewer.java | 272 ++++++++++++ .../answers/DataGeneratorWithExecutor.java | 311 ++++++++++++++ .../answers/DataGeneratorWithThread.java | 238 +++++++++++ .../dataviewer/answers/IDataGenerator.java | 59 +++ .../dataviewer/answers/SyncDataViewer.java | 182 ++++++++ .../dsf/requestmonitor/Async2Plus2.java | 40 ++ .../dsf/requestmonitor/AsyncHelloWorld.java | 46 ++ .../dsf/requestmonitor/AsyncQuicksort.java | 111 +++++ .../requestmonitor/answers/Async2Plus2.java | 40 ++ .../answers/AsyncHelloWorld.java | 44 ++ .../answers/AsyncQuicksort.java | 113 +++++ plugins/org.eclipse.dd.gdb.launch/.project | 6 + plugins/org.eclipse.dd.gdb.ui/.project | 6 + .../.settings/.api_filters | 155 +++++++ .../META-INF/MANIFEST.MF | 6 +- .../ui/actions/GdbConnectCommand.java | 1 - .../gdb/internal/ui/actions}/ProcessInfo.java | 4 +- plugins/org.eclipse.dd.gdb/.project | 6 + .../org.eclipse.dd.gdb/.settings/.api_filters | 115 +++++ .../org.eclipse.dd.gdb/META-INF/MANIFEST.MF | 12 +- .../IGDBLaunchConfigurationConstants.java | 4 + .../provisional/actions/IConnect.java | 3 + plugins/org.eclipse.dd.mi/.project | 6 + .../org.eclipse.dd.mi/META-INF/MANIFEST.MF | 2 +- .../dd/mi/service/ExpressionService.java | 4 + .../service/IMIExecutionGroupDMContext.java | 1 + .../dd/mi/service/IMIProcessDMContext.java | 1 + .../eclipse/dd/mi/service/IMIProcesses.java | 1 + .../eclipse/dd/mi/service/MIBreakpoints.java | 26 +- .../dd/mi/service/MIBreakpointsManager.java | 13 +- .../org/eclipse/dd/mi/service/MIMemory.java | 34 ++ .../org/eclipse/dd/mi/service/MIModules.java | 4 + .../eclipse/dd/mi/service/MIProcesses.java | 21 +- .../eclipse/dd/mi/service/MIRegisters.java | 16 + .../eclipse/dd/mi/service/MIRunControl.java | 77 +++- .../eclipse/dd/mi/service/MIRunControlNS.java | 37 ++ .../org/eclipse/dd/mi/service/MIStack.java | 29 +- .../dd/mi/service/MIVariableManager.java | 3 + .../service/command/AbstractCLIProcess.java | 10 + .../mi/service/command/AbstractMIControl.java | 9 + .../mi/service/command/CLIEventProcessor.java | 5 +- .../command/CLIEventProcessor_7_0.java | 1 + .../service/command/MIControlDMContext.java | 3 + .../mi/service/command/MIInferiorProcess.java | 34 +- .../MIRunControlEventProcessor_7_0.java | 1 + .../service/command/commands/CLIAttach.java | 3 + .../service/command/commands/CLIDetach.java | 1 + .../command/commands/CLIExecAbort.java | 8 + .../service/command/commands/CLISource.java | 8 + .../service/command/commands/MICommand.java | 6 + .../commands/MIDataEvaluateExpression.java | 9 + .../command/commands/MIEnvironmentCD.java | 1 + .../command/commands/MIExecContinue.java | 3 + .../command/commands/MIExecInterrupt.java | 3 + .../commands/MIFileExecAndSymbols.java | 15 + .../command/commands/MIFileExecFile.java | 15 + .../command/commands/MIFileSymbolFile.java | 15 + .../command/commands/MIGDBSetArgs.java | 1 + .../command/commands/MIGDBSetAutoSolib.java | 8 + .../commands/MIGDBSetBreakpointApply.java | 1 + .../command/commands/MIGDBSetNonStop.java | 1 + .../commands/MIGDBSetSolibSearchPath.java | 8 + .../command/commands/MIGDBSetSysroot.java | 1 + .../command/commands/MIGDBShowExitCode.java | 8 + .../command/commands/MIInferiorTTYSet.java | 8 + .../command/commands/MIListThreadGroups.java | 1 + .../command/commands/MITargetAttach.java | 1 + .../command/commands/MITargetDetach.java | 1 + .../command/commands/MIThreadInfo.java | 1 + .../command/commands/MIThreadSelect.java | 3 + .../service/command/commands/MIVarAssign.java | 9 +- .../service/command/commands/MIVarDelete.java | 8 + .../commands/MIVarEvaluateExpression.java | 8 + .../command/commands/MIVarInfoExpression.java | 10 +- .../commands/MIVarInfoPathExpression.java | 10 +- .../command/commands/MIVarInfoType.java | 10 +- .../command/commands/MIVarListChildren.java | 8 + .../command/commands/MIVarSetFormat.java | 8 + .../command/commands/MIVarShowAttributes.java | 10 +- .../command/commands/MIVarShowFormat.java | 8 + .../service/command/commands/MIVarUpdate.java | 8 + .../command/events/MIBreakpointHitEvent.java | 3 + .../command/events/MIDetachedEvent.java | 8 + .../events/MIFunctionFinishedEvent.java | 3 + .../command/events/MIGDBExitEvent.java | 9 + .../command/events/MIInferiorExitEvent.java | 15 + .../events/MIInferiorSignalExitEvent.java | 15 + .../events/MILocationReachedEvent.java | 3 + .../service/command/events/MISignalEvent.java | 3 + .../command/events/MISteppingRangeEvent.java | 3 + .../command/events/MIStoppedEvent.java | 3 + .../command/events/MIThreadCreatedEvent.java | 9 + .../command/events/MIThreadExitEvent.java | 9 + .../events/MIThreadGroupCreatedEvent.java | 1 + .../events/MIThreadGroupExitedEvent.java | 1 + .../events/MIWatchpointScopeEvent.java | 3 + .../events/MIWatchpointTriggerEvent.java | 3 + .../service/command/output/IThreadFrame.java | 3 + .../service/command/output/IThreadInfo.java | 3 + .../output/MIListThreadGroupsInfo.java | 1 + .../command/output/MIThreadInfoInfo.java | 1 + .../command/output/MIThreadListIdsInfo.java | 3 + .../service/command/output/ThreadFrame.java | 3 + .../mi/service/command/output/ThreadInfo.java | 7 +- 143 files changed, 4009 insertions(+), 74 deletions(-) create mode 100644 plugins/org.eclipse.dd.dsf.debug.ui/.settings/.api_filters create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/AsyncDataViewer.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/DataGeneratorWithExecutor.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/DataGeneratorWithThread.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/IDataGenerator.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/SyncDataViewer.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/AsyncDataViewer.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/DataGeneratorWithExecutor.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/DataGeneratorWithThread.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/IDataGenerator.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/SyncDataViewer.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/Async2Plus2.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/AsyncHelloWorld.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/AsyncQuicksort.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/Async2Plus2.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/AsyncHelloWorld.java create mode 100644 plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/AsyncQuicksort.java create mode 100644 plugins/org.eclipse.dd.gdb.ui/.settings/.api_filters rename plugins/{org.eclipse.dd.mi/src/org/eclipse/dd/mi/service => org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/actions}/ProcessInfo.java (92%) create mode 100644 plugins/org.eclipse.dd.gdb/.settings/.api_filters diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/.project b/plugins/org.eclipse.dd.dsf.debug.ui/.project index 264961c7dd3..310a76ab564 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/.project +++ b/plugins/org.eclipse.dd.dsf.debug.ui/.project @@ -20,9 +20,15 @@ + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/.settings/.api_filters b/plugins/org.eclipse.dd.dsf.debug.ui/.settings/.api_filters new file mode 100644 index 00000000000..2b1803dbdab --- /dev/null +++ b/plugins/org.eclipse.dd.dsf.debug.ui/.settings/.api_filters @@ -0,0 +1,395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.dd.dsf.debug.ui/META-INF/MANIFEST.MF index 52e4ccfd716..19d7c82f462 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.dd.dsf.debug.ui/META-INF/MANIFEST.MF @@ -29,17 +29,17 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.filesystem;bundle-version="1.2.0" Bundle-ActivationPolicy: lazy Export-Package: - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions, - org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.actions;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.expression;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.modules;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.actions;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.register;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions;x-internal:=true, + org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.variable;x-internal:=true, org.eclipse.dd.dsf.debug.ui, org.eclipse.dd.dsf.debug.ui.actions, org.eclipse.dd.dsf.debug.ui.contexts, diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/actions/AbstractVMProviderActionDelegate.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/actions/AbstractVMProviderActionDelegate.java index 32c04dc5d0c..66d24e2ae41 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/actions/AbstractVMProviderActionDelegate.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/actions/AbstractVMProviderActionDelegate.java @@ -29,6 +29,9 @@ import org.eclipse.ui.IActionDelegate2; import org.eclipse.ui.IViewActionDelegate; import org.eclipse.ui.IViewPart; +/** + * @since 1.1 + */ @SuppressWarnings("restriction") abstract public class AbstractVMProviderActionDelegate implements IViewActionDelegate, IDebugContextListener, IActionDelegate2 { diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/DefaultDsfModelSelectionPolicyFactory.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/DefaultDsfModelSelectionPolicyFactory.java index 00d1d7b19eb..0558b8635c1 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/DefaultDsfModelSelectionPolicyFactory.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/DefaultDsfModelSelectionPolicyFactory.java @@ -20,6 +20,7 @@ import org.eclipse.debug.ui.IDebugUIConstants; /** * Default model selection policy factory for DSF. + * @since 1.1 */ @SuppressWarnings("restriction") public class DefaultDsfModelSelectionPolicyFactory implements IModelSelectionPolicyFactory { diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/DefaultDsfSelectionPolicy.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/DefaultDsfSelectionPolicy.java index c835ffe313a..562541cfa51 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/DefaultDsfSelectionPolicy.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/launch/DefaultDsfSelectionPolicy.java @@ -30,6 +30,7 @@ import org.eclipse.jface.viewers.TreeSelection; /** * Default DSF selection policy implementation modelled after platform version * (DefaultSelectionPolicy). + * @since 1.1 */ @SuppressWarnings("restriction") public class DefaultDsfSelectionPolicy implements IModelSelectionPolicy { diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterBitFieldVMNode.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterBitFieldVMNode.java index 678d6f86d47..16525a24948 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterBitFieldVMNode.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterBitFieldVMNode.java @@ -149,7 +149,7 @@ public class RegisterBitFieldVMNode extends AbstractExpressionVMNode } private SyncRegisterDataAccess fSyncRegisterDataAccess = null; - private IWatchExpressionFactoryAdapter2 fBitFieldExpressionFactory = null; + protected IWatchExpressionFactoryAdapter2 fBitFieldExpressionFactory = null; private final IFormattedValuePreferenceStore fFormattedPrefStore; public RegisterBitFieldVMNode(IFormattedValuePreferenceStore prefStore, AbstractDMVMProvider provider, DsfSession session, SyncRegisterDataAccess access) { @@ -168,10 +168,16 @@ public class RegisterBitFieldVMNode extends AbstractExpressionVMNode return fFormattedPrefStore; } + /** + * @since 1.1 + */ public SyncRegisterDataAccess getSyncRegisterDataAccess() { return fSyncRegisterDataAccess; } + /** + * @since 1.1 + */ public IWatchExpressionFactoryAdapter2 getWatchExpressionFactory() { if ( fBitFieldExpressionFactory == null ) { fBitFieldExpressionFactory = new BitFieldExpressionFactory(); diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterGroupVMNode.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterGroupVMNode.java index 8445a3e4cf6..de94c23924e 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterGroupVMNode.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterGroupVMNode.java @@ -143,6 +143,9 @@ public class RegisterGroupVMNode extends AbstractExpressionVMNode return fSyncRegisterDataAccess; } + /** + * @since 1.1 + */ public IWatchExpressionFactoryAdapter2 getWatchExpressionFactory() { if ( fRegisterGroupExpressionFactory == null ) { fRegisterGroupExpressionFactory = new RegisterGroupExpressionFactory(); diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMNode.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMNode.java index 9c9016cbaa2..59d13be8bc3 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMNode.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMNode.java @@ -165,6 +165,9 @@ public class RegisterVMNode extends AbstractExpressionVMNode return fFormattedPrefStore; } + /** + * @since 1.1 + */ public IWatchExpressionFactoryAdapter2 getWatchExpressionFactory() { if ( fRegisterExpressionFactory == null ) { fRegisterExpressionFactory = new RegisterExpressionFactory(); diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AllUpdateScopeAction.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AllUpdateScopeAction.java index 975ab009107..532627bf6d8 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AllUpdateScopeAction.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AllUpdateScopeAction.java @@ -13,7 +13,7 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.action import org.eclipse.dd.dsf.ui.viewmodel.update.AllUpdateScope; /** - * + * @since 1.1 */ public class AllUpdateScopeAction extends SelectUpdateScopeAction { diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AtomicUpdatePolicyAction.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AtomicUpdatePolicyAction.java index 00417c8e6ed..b29a7d2d362 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AtomicUpdatePolicyAction.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/AtomicUpdatePolicyAction.java @@ -16,6 +16,9 @@ import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; +/** + * @since 1.1 + */ public class AtomicUpdatePolicyAction extends AbstractVMProviderActionDelegate { private final static String ATOMIC_UPDATE = "ATOMIC_UPDATE"; diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/NonAtomicUpdatePolicyAction.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/NonAtomicUpdatePolicyAction.java index b247e880f3a..5ebfa0fb722 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/NonAtomicUpdatePolicyAction.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/NonAtomicUpdatePolicyAction.java @@ -16,6 +16,9 @@ import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; +/** + * @since 1.1 + */ public class NonAtomicUpdatePolicyAction extends AbstractVMProviderActionDelegate { private final static String ATOMIC_UPDATE = "ATOMIC_UPDATE"; diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/SelectUpdateScopeAction.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/SelectUpdateScopeAction.java index f58497189cd..4a1ca887fd3 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/SelectUpdateScopeAction.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/SelectUpdateScopeAction.java @@ -21,7 +21,7 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.IViewPart; /** - * + * @since 1.1 */ public class SelectUpdateScopeAction extends AbstractVMProviderActionDelegate { diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/VisibleUpdateScopeAction.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/VisibleUpdateScopeAction.java index e916c52142a..072224493a4 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/VisibleUpdateScopeAction.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/update/actions/VisibleUpdateScopeAction.java @@ -13,7 +13,7 @@ package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.action import org.eclipse.dd.dsf.ui.viewmodel.update.VisibleUpdateScope; /** - * + * @since 1.1 */ public class VisibleUpdateScopeAction extends SelectUpdateScopeAction { diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/SyncVariableDataAccess.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/SyncVariableDataAccess.java index 5dd82c0c9b8..48b9843ecbe 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/SyncVariableDataAccess.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/variable/SyncVariableDataAccess.java @@ -458,6 +458,9 @@ public class SyncVariableDataAccess { } } + /** + * @since 1.1 + */ public class CanWriteExpressionQuery extends Query { private IExpressionDMContext fDmc; diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/DsfDebugUITools.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/DsfDebugUITools.java index 6d44924a626..e25135b1e37 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/DsfDebugUITools.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/DsfDebugUITools.java @@ -14,6 +14,9 @@ package org.eclipse.dd.dsf.debug.ui; import org.eclipse.dd.dsf.debug.internal.ui.DsfDebugUIPlugin; import org.eclipse.jface.preference.IPreferenceStore; +/** + * @since 1.1 + */ public class DsfDebugUITools { public static IPreferenceStore getPreferenceStore() diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java index a6b6425fe1d..e5b3437c69d 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java @@ -768,6 +768,9 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl startAnnotationClearingJob(e.getDMContext()); } + /** + * @since 1.1 + */ @DsfServiceEventHandler public void eventDispatched(SteppingTimedOutEvent e) { startAnnotationClearingJob(e.getDMContext()); diff --git a/plugins/org.eclipse.dd.dsf.debug/.project b/plugins/org.eclipse.dd.dsf.debug/.project index 340615eaab4..b77fd243b56 100644 --- a/plugins/org.eclipse.dd.dsf.debug/.project +++ b/plugins/org.eclipse.dd.dsf.debug/.project @@ -20,9 +20,15 @@ + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/AbstractDsfDebugServicesFactory.java b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/AbstractDsfDebugServicesFactory.java index 1fcceb81454..b958d2460d5 100644 --- a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/AbstractDsfDebugServicesFactory.java +++ b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/AbstractDsfDebugServicesFactory.java @@ -13,6 +13,10 @@ package org.eclipse.dd.dsf.debug.service; import org.eclipse.dd.dsf.debug.service.command.ICommandControl; import org.eclipse.dd.dsf.service.DsfSession; +/** + * Convenience base class for {@link IDsfDebugServicesFactory} + * @since 1.1 + */ public abstract class AbstractDsfDebugServicesFactory implements IDsfDebugServicesFactory { @SuppressWarnings("unchecked") diff --git a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IDsfDebugServicesFactory.java b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IDsfDebugServicesFactory.java index 7d4b9040b46..1e6b87657be 100644 --- a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IDsfDebugServicesFactory.java +++ b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IDsfDebugServicesFactory.java @@ -12,9 +12,10 @@ package org.eclipse.dd.dsf.debug.service; import org.eclipse.dd.dsf.service.DsfSession; -/* +/** * A factory to create DSF services. Using this interface allows * to easily have different service implementation for different backends. + * @since 1.1 */ public interface IDsfDebugServicesFactory { V createService(Class clazz, DsfSession session, Object ... optionalArguments); diff --git a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IProcesses.java b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IProcesses.java index 9af09678798..eec93d09dd1 100644 --- a/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IProcesses.java +++ b/plugins/org.eclipse.dd.dsf.debug/src/org/eclipse/dd/dsf/debug/service/IProcesses.java @@ -24,6 +24,7 @@ import org.eclipse.dd.dsf.datamodel.IDMService; * This service provides a relatively simple interface for * manipulating processes as compared with a full-blown * remote target debugger. + * @since 1.1 */ public interface IProcesses extends IDMService { diff --git a/plugins/org.eclipse.dd.dsf.ui/.project b/plugins/org.eclipse.dd.dsf.ui/.project index 2ae0cefded6..cf14fdd3b0b 100644 --- a/plugins/org.eclipse.dd.dsf.ui/.project +++ b/plugins/org.eclipse.dd.dsf.ui/.project @@ -20,9 +20,15 @@ + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/AbstractVMProvider.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/AbstractVMProvider.java index c3f4caa72da..ab18341f011 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/AbstractVMProvider.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/AbstractVMProvider.java @@ -65,8 +65,13 @@ import org.eclipse.swt.widgets.Display; abstract public class AbstractVMProvider implements IVMProvider, IVMEventListener { // debug flags + /** @since 1.1 */ public static String DEBUG_PRESENTATION_ID = null; + + /** @since 1.1 */ public static boolean DEBUG_CONTENT_PROVIDER = false; + + /** @since 1.1 */ public static boolean DEBUG_DELTA = false; static { @@ -385,6 +390,7 @@ abstract public class AbstractVMProvider implements IVMProvider, IVMEventListene return false; } + /** @since 1.1 */ public boolean shouldWaitHandleEventToComplete() { return false; } diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java index 8acb4ae10b9..c8c3f4044bd 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java @@ -103,10 +103,12 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy, IVMModelProxy return fRootElement; } - public Object getViewerInput() { + /** @since 1.1 */ + public Object getViewerInput() { return fRootElement; } + /** @since 1.1 */ public TreePath getRootPath() { return TreePath.EMPTY; } @@ -237,6 +239,8 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy, IVMModelProxy * Returns the viewer this proxy is installed in. * * @return viewer or null if not installed + * + * @since 1.1 */ public Viewer getViewer() { return fViewer; diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/IVMModelProxyExtension.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/IVMModelProxyExtension.java index ab4ada03766..969a7ee8d15 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/IVMModelProxyExtension.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/IVMModelProxyExtension.java @@ -16,6 +16,8 @@ import org.eclipse.jface.viewers.Viewer; /** * View Model extension to IVMModelProxy interface. This extension * allows access to the viewer. + * + * @since 1.1 */ public interface IVMModelProxyExtension extends IVMModelProxy { diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/datamodel/AbstractDMVMNode.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/datamodel/AbstractDMVMNode.java index d385b397ab7..4f9870edbe4 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/datamodel/AbstractDMVMNode.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/datamodel/AbstractDMVMNode.java @@ -340,6 +340,8 @@ abstract public class AbstractDMVMNode extends AbstractVMNode implements IVMNode * @param update the viewer update request * @param dmcs the data model contexts * @param firstIndex the index of the first data model context + * + * @since 1.1 */ protected void fillUpdateWithVMCs(IChildrenUpdate update, IDMContext[] dmcs, int firstIndex) { int updateIdx = update.getOffset() != -1 ? update.getOffset() : 0; diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java index 73e5e5a7918..21f230e6e57 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java @@ -68,6 +68,9 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa private boolean fDelayEventHandleForViewUpdate = false; // debug flags + /** + * @since 1.1 + */ public static boolean DEBUG_CACHE = false; static { @@ -305,6 +308,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa } protected static String SELECTED_UPDATE_MODE = "org.eclipse.dd.dsf.ui.viewmodel.update.selectedUpdateMode"; //$NON-NLS-1$ + + /** + * @since 1.1 + */ protected static String SELECTED_UPDATE_SCOPE = "org.eclipse.dd.dsf.ui.viewmodel.update.selectedUpdateScope"; //$NON-NLS-1$ private IVMUpdatePolicy[] fAvailableUpdatePolicies; @@ -351,6 +358,9 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa return new IVMUpdatePolicy[] { new AutomaticUpdatePolicy() }; } + /** + * @since 1.1 + */ protected IVMUpdateScope[] createUpdateScopes() { return new IVMUpdateScope[] { new VisibleUpdateScope(), new AllUpdateScope() }; } @@ -1230,10 +1240,16 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa return null; } + /** + * @since 1.1 + */ public IVMUpdateScope[] getAvailableUpdateScopes() { return fAvailableUpdateScopes; } + /** + * @since 1.1 + */ public IVMUpdateScope getActiveUpdateScope() { String updateScopeId = (String)getPresentationContext().getProperty(SELECTED_UPDATE_SCOPE); if (updateScopeId != null) { @@ -1248,14 +1264,21 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa return getAvailableUpdateScopes()[0]; } + /** + * @since 1.1 + */ public void setActiveUpdateScope(IVMUpdateScope updateScope) { getPresentationContext().setProperty(SELECTED_UPDATE_SCOPE, updateScope.getID()); } + @Override public boolean shouldWaitHandleEventToComplete() { return fDelayEventHandleForViewUpdate; } + /** + * @since 1.1 + */ protected void setDelayEventHandleForViewUpdate(boolean on) { fDelayEventHandleForViewUpdate = on; } diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AllUpdateScope.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AllUpdateScope.java index 5a7fe7ad1f5..ae1150026c1 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AllUpdateScope.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/AllUpdateScope.java @@ -16,6 +16,8 @@ import org.eclipse.jface.viewers.TreePath; * An "automatic" update policy which causes the view model provider cache to * be flushed whenever an event causes a delta to be generated in the given * model. + * + * @since 1.1 */ public class AllUpdateScope implements IVMUpdateScope { diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/IVMUpdateScope.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/IVMUpdateScope.java index 3a5a6f233a3..7149702d09e 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/IVMUpdateScope.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/IVMUpdateScope.java @@ -11,8 +11,8 @@ package org.eclipse.dd.dsf.ui.viewmodel.update; -/** - * +/** + * @since 1.1 */ public interface IVMUpdateScope { diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/UpdatePolicyDecorator.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/UpdatePolicyDecorator.java index 556d2579466..48014cb533d 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/UpdatePolicyDecorator.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/UpdatePolicyDecorator.java @@ -12,6 +12,8 @@ package org.eclipse.dd.dsf.ui.viewmodel.update; /** * An update policy decorator which can override behaviour of an underlying update policy. + * + * @since 1.1 */ public abstract class UpdatePolicyDecorator implements IVMUpdatePolicy { diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/ViewModelUpdateMessages.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/ViewModelUpdateMessages.java index f7d98d2d99b..14b966bb922 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/ViewModelUpdateMessages.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/ViewModelUpdateMessages.java @@ -18,7 +18,13 @@ public class ViewModelUpdateMessages extends NLS { public static String AutomaticUpdatePolicy_name; public static String ManualUpdatePolicy_name; + /** + * @since 1.1 + */ public static String AllUpdateScope_name; + /** + * @since 1.1 + */ public static String VisibleUpdateScope_name; static { diff --git a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/VisibleUpdateScope.java b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/VisibleUpdateScope.java index fae123f0d8a..5201f166a08 100644 --- a/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/VisibleUpdateScope.java +++ b/plugins/org.eclipse.dd.dsf.ui/src/org/eclipse/dd/dsf/ui/viewmodel/update/VisibleUpdateScope.java @@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.TreePath; * An "automatic" update policy which causes the view model provider cache to * be flushed whenever an event causes a delta to be generated in the given * model. + * @since 1.1 */ public class VisibleUpdateScope implements IVMUpdateScope { diff --git a/plugins/org.eclipse.dd.dsf/.project b/plugins/org.eclipse.dd.dsf/.project index 63ae142e1be..58988a3056c 100644 --- a/plugins/org.eclipse.dd.dsf/.project +++ b/plugins/org.eclipse.dd.dsf/.project @@ -20,9 +20,15 @@ + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/datamodel/DMContexts.java b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/datamodel/DMContexts.java index 54306ec86d4..d2b95cf2cc7 100644 --- a/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/datamodel/DMContexts.java +++ b/plugins/org.eclipse.dd.dsf/src/org/eclipse/dd/dsf/datamodel/DMContexts.java @@ -78,6 +78,7 @@ public class DMContexts { * @param ctx DMC to search. * @param ancestorType Class type of the desired DMC ancestor. * @return Returns all ancestors found, null if none. + * @since 1.1 */ @ThreadSafe @SuppressWarnings("unchecked") diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/AsyncDataViewer.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/AsyncDataViewer.java new file mode 100644 index 00000000000..54f2caad63a --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/AsyncDataViewer.java @@ -0,0 +1,272 @@ +/******************************************************************************* + * Copyright (c) 2006, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor; +import org.eclipse.dd.dsf.concurrent.ThreadSafe; +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.DsfExecutor; +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; +import org.eclipse.dd.dsf.concurrent.Query; +import org.eclipse.dd.dsf.ui.concurrent.DisplayDsfExecutor; +import org.eclipse.jface.viewers.ILazyContentProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Table; + +/** + * Data viewer based on a table, which reads data using asynchronous methods. + *

+ * This viewer implements the {@link ILazyContentProvider} interface + * which is used by the JFace TableViewer class to populate a Table. This + * interface contains separate asynchronous methods for requesting the count + * and values for individual indexes, which neatly correspond to the methods + * in {@link IDataGenerator}. As an added optimization, this viewer + * implementation checks for the range of visible items in the view upon each + * request, and it cancels old requests which scroll out of view but have not + * been completed yet. However, it is up to the data generator implementation + * to check the canceled state of the requests and ignore them. + *

+ */ +@ConfinedToDsfExecutor("fDisplayExecutor") +public class AsyncDataViewer + implements ILazyContentProvider, IDataGenerator.Listener +{ + // Executor to use instead of Display.asyncExec(). + @ThreadSafe + final private DsfExecutor fDisplayExecutor; + + // The viewer and generator that this content provider using. + final private TableViewer fViewer; + final private IDataGenerator fDataGenerator; + + // Fields used in request cancellation logic. + private List fItemDataRequestMonitors = new LinkedList(); + private Set fIndexesToCancel = new HashSet(); + private int fCancelCallsPending = 0; + + public AsyncDataViewer(TableViewer viewer, IDataGenerator generator) { + fViewer = viewer; + fDisplayExecutor = DisplayDsfExecutor.getDisplayDsfExecutor(fViewer.getTable().getDisplay()); + fDataGenerator = generator; + fDataGenerator.addListener(this); + } + + public void dispose() { + fDataGenerator.removeListener(this); + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + // Set the initial count to the viewer after the input is set. + queryItemCount(); + } + + public void updateElement(final int index) { + // Calculate the visible index range. + final int topIdx = fViewer.getTable().getTopIndex(); + final int botIdx = topIdx + getVisibleItemCount(topIdx); + + // Request the item for the given index. + queryValue(index); + + // Invoke a cancel task with a delay. The delay allows multiple cancel + // calls to be combined together improving performance of the viewer. + fCancelCallsPending++; + fDisplayExecutor.schedule( + new Runnable() { public void run() { + cancelStaleRequests(topIdx, botIdx); + }}, + 1, TimeUnit.MILLISECONDS); + } + + private int getVisibleItemCount(int top) { + Table table = fViewer.getTable(); + int itemCount = table.getItemCount(); + return Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - top); + } + + @ThreadSafe + public void countChanged() { + queryItemCount(); + } + + @ThreadSafe + public void valuesChanged(final Set indexes) { + // Mark the changed items in table viewer as dirty, this will + // trigger update requests for these indexes if they are + // visible in the viewer. + final TableViewer tableViewer = fViewer; + fDisplayExecutor.execute( new Runnable() { + public void run() { + if (!fViewer.getTable().isDisposed()) { + for (Integer index : indexes) { + tableViewer.clear(index); + } + } + }}); + } + + + private void queryItemCount() { + // Request count from data provider. When the count is returned, we + // have to re-dispatch into the display thread to avoid calling + // the table widget on the DSF dispatch thread. + fIndexesToCancel.clear(); + fDataGenerator.getCount( + // Use the display executor to construct the request monitor, this + // will cause the handleCompleted() method to be automatically + // called on the display thread. + new DataRequestMonitor(fDisplayExecutor, null) { + @Override + protected void handleCompleted() { + if (!fViewer.getTable().isDisposed()) { + fViewer.setItemCount(getData()); + fViewer.getTable().clearAll(); + } + } + }); + + } + + + // Dedicated class for data item requests. This class holds the index + // argument so it can be examined when canceling stale requests. + private class ValueDataRequestMonitor extends DataRequestMonitor { + + /** Index is used when canceling stale requests. */ + int fIndex; + + ValueDataRequestMonitor(int index) { + super(fDisplayExecutor, null); + fIndex = index; + } + + @Override + protected void handleCompleted() { + fItemDataRequestMonitors.remove(this); + + // Check if the request completed successfully, otherwise ignore it. + if (isSuccess()) { + if (!fViewer.getTable().isDisposed()) { + fViewer.replace(getData(), fIndex); + } + } + } + } + + private void queryValue(final int index) { + ValueDataRequestMonitor rm = new ValueDataRequestMonitor(index); + fItemDataRequestMonitors.add(rm); + fDataGenerator.getValue(index, rm); + } + + private void cancelStaleRequests(int topIdx, int botIdx) { + // Decrement the count of outstanding cancel calls. + fCancelCallsPending--; + + // Must check again, in case disposed while re-dispatching. + if (fDataGenerator == null || fViewer.getTable().isDisposed()) return; + + // Go through the outstanding requests and cancel any that + // are not visible anymore. + for (Iterator itr = fItemDataRequestMonitors.iterator(); itr.hasNext();) { + ValueDataRequestMonitor item = itr.next(); + if (item.fIndex < topIdx || item.fIndex > botIdx) { + // Set the item to canceled status, so that the data provider + // will ignore it. + item.cancel(); + + // Add the item index to list of indexes that were canceled, + // which will be sent to the table widget. + fIndexesToCancel.add(item.fIndex); + + // Remove the item from the outstanding cancel requests. + itr.remove(); + } + } + if (!fIndexesToCancel.isEmpty() && fCancelCallsPending == 0) { + Set canceledIdxs = fIndexesToCancel; + fIndexesToCancel = new HashSet(); + + // Clear the indexes of the canceled request, so that the + // viewer knows to request them again when needed. + // Note: clearing using TableViewer.clear(int) seems very + // inefficient, it's better to use Table.clear(int[]). + int[] canceledIdxsArray = new int[canceledIdxs.size()]; + int i = 0; + for (Integer index : canceledIdxs) { + canceledIdxsArray[i++] = index; + } + fViewer.getTable().clear(canceledIdxsArray); + } + } + + + public static void main(String[] args) { + // Create the shell to hold the viewer. + Display display = new Display(); + Shell shell = new Shell(display, SWT.SHELL_TRIM); + shell.setLayout(new GridLayout()); + GridData data = new GridData(GridData.FILL_BOTH); + shell.setLayoutData(data); + Font font = new Font(display, "Courier", 10, SWT.NORMAL); + + // Create the table viewer. + TableViewer tableViewer = new TableViewer(shell, SWT.BORDER | SWT.VIRTUAL); + tableViewer.getControl().setLayoutData(data); + + // Create the data generator. + final IDataGenerator generator = new DataGeneratorWithExecutor(); + + // Create the content provider which will populate the viewer. + AsyncDataViewer contentProvider = new AsyncDataViewer(tableViewer, generator); + tableViewer.setContentProvider(contentProvider); + tableViewer.setInput(new Object()); + + // Open the shell and service the display dispatch loop until user + // closes the shell. + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) + display.sleep(); + } + + // The IDataGenerator.shutdown() method is asynchronous, this requires + // using a query again in order to wait for its completion. + Query shutdownQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + generator.shutdown(rm); + } + }; + ImmediateExecutor.getInstance().execute(shutdownQuery); + try { + shutdownQuery.get(); + } catch (Exception e) {} + + // Shut down the display. + font.dispose(); + display.dispose(); + } +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/DataGeneratorWithExecutor.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/DataGeneratorWithExecutor.java new file mode 100644 index 00000000000..56cd6e05418 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/DataGeneratorWithExecutor.java @@ -0,0 +1,336 @@ +/******************************************************************************* + * Copyright (c) 2006, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer; + +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.TimeUnit; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.DefaultDsfExecutor; +import org.eclipse.dd.dsf.concurrent.DsfExecutor; +import org.eclipse.dd.dsf.concurrent.DsfRunnable; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; +import org.eclipse.dd.examples.dsf.DsfExamplesPlugin; + +/** + * DSF Executor-based implementation of the data generator. + *

+ * This generator uses a queue of client requests and processes these + * requests periodically using a DSF executor. The main feature of this + * generator is that it uses the executor as its only synchronization object. + * This means that all the fields with the exception of the executor can only + * be accessed while running in the executor thread. + *

+ */ +//TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) +//indicating allowed thread access to this class/method/member +public class DataGeneratorWithExecutor implements IDataGenerator { + + // Request objects are used to serialize the interface calls into objects + // which can then be pushed into a queue. + // TODO Ecercise 4 - Add an annotationindicating allowed concurrency access + // Hint: Request and its subclasses have all their fields declared as final. + abstract class Request { + final RequestMonitor fRequestMonitor; + + Request(RequestMonitor rm) { + fRequestMonitor = rm; + } + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + class CountRequest extends Request { + CountRequest(DataRequestMonitor rm) { + super(rm); + } + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + class ItemRequest extends Request { + final int fIndex; + ItemRequest(int index, DataRequestMonitor rm) { + super(rm); + fIndex = index; + } + } + + // The executor used to access all internal data of the generator. + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + // Hint: If a member does not have an annotation, the programmer can assume + // that the concurrency rule that applies to the class also applies to this + // member. + private DsfExecutor fExecutor; + + // Main request queue of the data generator. The getValue(), getCount(), + // and shutdown() methods write into the queue, while the serviceQueue() + // method reads from it. + // The executor used to access all internal data of the generator. + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private List fQueue = new LinkedList(); + + // List of listeners is not synchronized, it also has to be accessed + // using the executor. + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private List fListeners = new LinkedList(); + + // Current number of elements in this generator. + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private int fCount = MIN_COUNT; + + // Counter used to determine when to reset the element count. + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private int fCountResetTrigger = 0; + + // Elements which were modified since the last reset. + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private Set fChangedIndexes = new HashSet(); + + // Flag used to ensure that requests are processed sequentially. + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private boolean fServiceQueueInProgress = false; + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + public DataGeneratorWithExecutor() { + // Create the executor + fExecutor = new DefaultDsfExecutor("Supplier Executor"); + + // Schedule a runnable to make the random changes. + fExecutor.scheduleAtFixedRate( + new DsfRunnable() { + public void run() { + randomChanges(); + } + }, + RANDOM_CHANGE_INTERVAL, + RANDOM_CHANGE_INTERVAL, + TimeUnit.MILLISECONDS); + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + public void shutdown(final RequestMonitor rm) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + // Empty the queue of requests and fail them. + for (Request request : fQueue) { + request.fRequestMonitor.setStatus( + new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + request.fRequestMonitor.done(); + } + fQueue.clear(); + + // Kill executor. + fExecutor.shutdown(); + rm.done(); + } + }); + } catch (RejectedExecutionException e) { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + public void getCount(final DataRequestMonitor rm) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + fQueue.add(new CountRequest(rm)); + serviceQueue(); + } + }); + } catch (RejectedExecutionException e) { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + public void getValue(final int index, final DataRequestMonitor rm) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + fQueue.add(new ItemRequest(index, rm)); + serviceQueue(); + } + }); + } catch (RejectedExecutionException e) { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + public void addListener(final Listener listener) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + fListeners.add(listener); + } + }); + } catch (RejectedExecutionException e) {} + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + public void removeListener(final Listener listener) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + fListeners.remove(listener); + } + }); + } catch (RejectedExecutionException e) {} + } + + // Main processing function of this generator. + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private void serviceQueue() { + + // TODO Exercise 3 - Add logic to discard cancelled requests from queue. + // Hint: Since serviceQueue() is called using the executor, and the + // fQueue list can only be modified when running in the executor + // thread. This method can safely iterate and modify fQueue without + // risk of race conditions or concurrent modification exceptions. + + // If a queue servicing is already scheduled, do nothing. + if (fServiceQueueInProgress) { + return; + } + + if (fQueue.size() != 0) { + // If there are requests to service, remove one from the queue and + // schedule a runnable to process the request after a processing + // delay. + fServiceQueueInProgress = true; + final Request request = fQueue.remove(0); + fExecutor.schedule( + new DsfRunnable() { + public void run() { + if (request instanceof CountRequest) { + processCountRequest((CountRequest)request); + } else if (request instanceof ItemRequest) { + processItemRequest((ItemRequest)request); + } + + // Reset the processing flag and process next + // request. + fServiceQueueInProgress = false; + serviceQueue(); + } + }, + PROCESSING_DELAY, TimeUnit.MILLISECONDS); + } + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private void processCountRequest(CountRequest request) { + @SuppressWarnings("unchecked") // Suppress warning about lost type info. + DataRequestMonitor rm = (DataRequestMonitor)request.fRequestMonitor; + + rm.setData(fCount); + rm.done(); + } + + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private void processItemRequest(ItemRequest request) { + @SuppressWarnings("unchecked") // Suppress warning about lost type info. + DataRequestMonitor rm = (DataRequestMonitor)request.fRequestMonitor; + + if (fChangedIndexes.contains(request.fIndex)) { + rm.setData("Changed: " + request.fIndex); + } else { + rm.setData(Integer.toString(request.fIndex)); + } + rm.done(); + } + + /** + * This method simulates changes in the supplier's data set. + */ + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private void randomChanges() { + // Once every number of changes, reset the count, the rest of the + // times just change certain values. + if (++fCountResetTrigger % RANDOM_COUNT_CHANGE_INTERVALS == 0){ + randomCountReset(); + } else { + randomDataChange(); + } + } + + /** + * Calculates new size for provider's data set. + */ + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private void randomCountReset() { + // Calculate the new count. + Random random = new java.util.Random(); + fCount = MIN_COUNT + Math.abs(random.nextInt()) % (MAX_COUNT - MIN_COUNT); + + // Reset the changed values. + fChangedIndexes.clear(); + + // Notify listeners + for (Listener listener : fListeners) { + listener.countChanged(); + } + } + + /** + * Invalidates a random range of indexes. + */ + // TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) + // indicating allowed thread access to this class/method/member + private void randomDataChange() { + // Calculate the indexes to change. + Random random = new java.util.Random(); + Set set = new HashSet(); + for (int i = 0; i < fCount * RANDOM_CHANGE_SET_PERCENTAGE / 100; i++) { + set.add( new Integer(Math.abs(random.nextInt()) % fCount) ); + } + + // Add the indexes to an overall set of changed indexes. + fChangedIndexes.addAll(set); + + // Notify listeners + for (Listener listener : fListeners) { + listener.valuesChanged(set); + } + } +} + diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/DataGeneratorWithThread.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/DataGeneratorWithThread.java new file mode 100644 index 00000000000..04fab7aaf2e --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/DataGeneratorWithThread.java @@ -0,0 +1,238 @@ +/******************************************************************************* + * Copyright (c) 2006, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.ListenerList; +import org.eclipse.core.runtime.Status; +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; +import org.eclipse.dd.examples.dsf.DsfExamplesPlugin; + +/** + * Thread-based implementation of the data generator. + *

+ * This generator is based around a queue of client requests and a thread which + * reads the requests from the queue and processes them. The distinguishing + * feature of this generator is that it uses a a blocking queue as the main + * synchronization object. However, fListeners, fShutdown, and fChangedIndexes + * fields also need to be thread-safe and so they implement their own + * synchronization. + *

+ */ +public class DataGeneratorWithThread extends Thread implements IDataGenerator { + + // Request objects are used to serialize the interface calls into objects + // which can then be pushed into a queue. + abstract class Request { + final RequestMonitor fRequestMonitor; + + Request(RequestMonitor rm) { + fRequestMonitor = rm; + } + } + + class CountRequest extends Request { + CountRequest(DataRequestMonitor rm) { + super(rm); + } + } + + class ItemRequest extends Request { + final int fIndex; + ItemRequest(int index, DataRequestMonitor rm) { + super(rm); + fIndex = index; + } + } + + class ShutdownRequest extends Request { + ShutdownRequest(RequestMonitor rm) { + super(rm); + } + } + + // Main request queue of the data generator. The getValue(), getCount(), + // and shutdown() methods write into the queue, while the run() method + // reads from it. + private final BlockingQueue fQueue = new LinkedBlockingQueue(); + + // ListenerList class provides thread safety. + private ListenerList fListeners = new ListenerList(); + + // Current number of elements in this generator. + private int fCount = MIN_COUNT; + + // Counter used to determine when to reset the element count. + private int fCountResetTrigger = 0; + + // Elements which were modified since the last reset. + private Set fChangedIndexes = Collections.synchronizedSet(new HashSet()); + + // Used to determine when to make changes in data. + private long fLastChangeTime = System.currentTimeMillis(); + + // Flag indicating when the generator has been shut down. + private AtomicBoolean fShutdown = new AtomicBoolean(false); + + public DataGeneratorWithThread() { + // Immediately kick off the request processing thread. + start(); + } + + public void shutdown(RequestMonitor rm) { + // Mark the generator as shut down. After the fShutdown flag is set, + // all new requests should be shut down. + if (!fShutdown.getAndSet(true)) { + fQueue.add(new ShutdownRequest(rm)); + } else { + // + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void getCount(DataRequestMonitor rm) { + if (!fShutdown.get()) { + fQueue.add(new CountRequest(rm)); + } else { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void getValue(int index, DataRequestMonitor rm) { + if (!fShutdown.get()) { + fQueue.add(new ItemRequest(index, rm)); + } else { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void addListener(Listener listener) { + fListeners.add(listener); + } + + public void removeListener(Listener listener) { + fListeners.remove(listener); + } + + @Override + public void run() { + try { + while(true) { + // Get the next request from the queue. The time-out + // ensures that that the random changes get processed. + final Request request = fQueue.poll(100, TimeUnit.MILLISECONDS); + + // If a request was dequeued, process it. + if (request != null) { + // Simulate a processing delay. + Thread.sleep(PROCESSING_DELAY); + + if (request instanceof CountRequest) { + processCountRequest((CountRequest)request); + } else if (request instanceof ItemRequest) { + processItemRequest((ItemRequest)request); + } else if (request instanceof ShutdownRequest) { + // If shutting down, just break out of the while(true) + // loop and thread will exit. + request.fRequestMonitor.done(); + break; + } + } + + // Simulate data changes. + randomChanges(); + } + } + catch (InterruptedException x) {} + } + + private void processCountRequest(CountRequest request) { + @SuppressWarnings("unchecked") // Suppress warning about lost type info. + DataRequestMonitor rm = (DataRequestMonitor)request.fRequestMonitor; + + rm.setData(fCount); + rm.done(); + } + + private void processItemRequest(ItemRequest request) { + @SuppressWarnings("unchecked") // Suppress warning about lost type info. + DataRequestMonitor rm = (DataRequestMonitor)request.fRequestMonitor; + + if (fChangedIndexes.contains(request.fIndex)) { + rm.setData("Changed: " + request.fIndex); + } else { + rm.setData(Integer.toString(request.fIndex)); + } + rm.done(); + } + + + private void randomChanges() { + // Check if enough time is elapsed. + if (System.currentTimeMillis() > fLastChangeTime + RANDOM_CHANGE_INTERVAL) { + fLastChangeTime = System.currentTimeMillis(); + + // Once every number of changes, reset the count, the rest of the + // times just change certain values. + if (++fCountResetTrigger % RANDOM_COUNT_CHANGE_INTERVALS == 0){ + randomCountReset(); + } else { + randomDataChange(); + } + } + } + + private void randomCountReset() { + // Calculate the new count. + Random random = new java.util.Random(); + fCount = MIN_COUNT + Math.abs(random.nextInt()) % (MAX_COUNT - MIN_COUNT); + + // Reset the changed values. + fChangedIndexes.clear(); + + // Notify listeners + for (Object listener : fListeners.getListeners()) { + ((Listener)listener).countChanged(); + } + } + + private void randomDataChange() { + // Calculate the indexes to change. + Random random = new java.util.Random(); + Set set = new HashSet(); + for (int i = 0; i < fCount * RANDOM_CHANGE_SET_PERCENTAGE / 100; i++) { + set.add( new Integer(Math.abs(random.nextInt()) % fCount) ); + } + + // Add the indexes to an overall set of changed indexes. + fChangedIndexes.addAll(set); + + // Notify listeners + for (Object listener : fListeners.getListeners()) { + ((Listener)listener).valuesChanged(set); + } + } +} + + diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/IDataGenerator.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/IDataGenerator.java new file mode 100644 index 00000000000..066eda82377 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/IDataGenerator.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2006, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer; + +import java.util.Set; + +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; + +/** + * Data generator is simple source of data used to populate the example table + * view. It contains two asynchronous methods for retrieving the data + * parameters: the count and the value for a given index. It also allows the + * view to receive events indicating when the data supplied by the generator + * is changed. + */ +// TODO Exercise 4 - Add an annotation (ThreadSafe/ConfinedToDsfExecutor) +// indicating allowed thread access to this class/method/member +public interface IDataGenerator { + + // Constants which control the data generator behavior. + // Changing the count range can stress the scalability of the system, while + // changing of the process delay and random change interval can stress + // its performance. + final static int MIN_COUNT = 100; + final static int MAX_COUNT = 200; + final static int PROCESSING_DELAY = 10; + final static int RANDOM_CHANGE_INTERVAL = 10000; + final static int RANDOM_COUNT_CHANGE_INTERVALS = 3; + final static int RANDOM_CHANGE_SET_PERCENTAGE = 10; + + + // Listener interface that the view needs to implement to react + // to the changes in data. + public interface Listener { + void countChanged(); + void valuesChanged(Set indexes); + } + + // Data access methods. + void getCount(DataRequestMonitor rm); + void getValue(int index, DataRequestMonitor rm); + + // Method used to shutdown the data generator including any threads that + // it may use. + void shutdown(RequestMonitor rm); + + // Methods for registering change listeners. + void addListener(Listener listener); + void removeListener(Listener listener); +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/SyncDataViewer.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/SyncDataViewer.java new file mode 100644 index 00000000000..d4d4bdc7fe7 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/SyncDataViewer.java @@ -0,0 +1,183 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer; + +import java.util.Set; + +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; +import org.eclipse.dd.dsf.concurrent.Query; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +/** + * Data viewer based on a table, which reads data using synchronous methods. + *

+ * This viewer implements the {@link IStructuredContentProvider} interface + * which is used by the JFace TableViewer class to populate a Table. This + * interface contains one principal methods for reading data {@link #getElements(Object)}, + * which synchronously returns an array of elements. In order to implement this + * method using the asynchronous data generator, this provider uses the + * {@link Query} object. + *

+ */ +public class SyncDataViewer + implements IStructuredContentProvider, IDataGenerator.Listener +{ + // The viewer and generator that this content provider using. + final private TableViewer fViewer; + final private IDataGenerator fDataGenerator; + + public SyncDataViewer(TableViewer viewer, IDataGenerator generator) { + fViewer = viewer; + fDataGenerator = generator; + fDataGenerator.addListener(this); + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + // Not used + } + + + public Object[] getElements(Object inputElement) { + + // Create the query object for reading data count. + Query countQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fDataGenerator.getCount(rm); + } + }; + + // Submit the query to be executed. A query implements a runnable + // interface and it has to be executed in order to do its work. + ImmediateExecutor.getInstance().execute(countQuery); + int count = 0; + + // Block until the query completes, which will happen when the request + // monitor of the execute() method is marked done. + try { + count = countQuery.get(); + } catch (Exception e) { + // InterruptedException and ExecutionException can be thrown here. + // ExecutionException containing a CoreException will be thrown + // if an error status is set to the Query's request monitor. + return new Object[0]; + } + + // Create the array that will be filled with elements. + // For each index in the array execute a query to get the element at + // that index. + final Object[] elements = new Object[count]; + + for (int i = 0; i < count; i++) { + final int index = i; + Query valueQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fDataGenerator.getValue(index, rm); + } + }; + ImmediateExecutor.getInstance().execute(valueQuery); + try { + elements[i] = valueQuery.get(); + } catch (Exception e) { + elements[i] = "error"; + } + } + return elements; + } + + public void dispose() { + fDataGenerator.removeListener(this); + } + + public void countChanged() { + // For any event from the generator, refresh the whole viewer. + refreshViewer(); + } + + public void valuesChanged(Set indexes) { + // For any event from the generator, refresh the whole viewer. + refreshViewer(); + } + + private void refreshViewer() { + // TODO Exercise 5 - Add a call to getElements() to force a deadlock. + + // This method may be called on any thread, switch to the display + // thread before calling the viewer. + Display display = fViewer.getControl().getDisplay(); + display.asyncExec( new Runnable() { + public void run() { + if (!fViewer.getControl().isDisposed()) { + fViewer.refresh(); + } + } + }); + } + + public static void main(String[] args) { + // Create the shell to hold the viewer. + Display display = new Display(); + Shell shell = new Shell(display, SWT.SHELL_TRIM); + shell.setLayout(new GridLayout()); + GridData data = new GridData(GridData.FILL_BOTH); + shell.setLayoutData(data); + Font font = new Font(display, "Courier", 10, SWT.NORMAL); + + // Create the table viewer. + TableViewer tableViewer = new TableViewer(shell, SWT.BORDER); + tableViewer.getControl().setLayoutData(data); + + // Create the data generator. + // TODO Exercise 5 - Use the DataGeneratorWithExecutor() instead. + final IDataGenerator generator = new DataGeneratorWithThread(); + + // Create the content provider which will populate the viewer. + SyncDataViewer contentProvider = new SyncDataViewer(tableViewer, generator); + tableViewer.setContentProvider(contentProvider); + tableViewer.setInput(new Object()); + + // Open the shell and service the display dispatch loop until user + // closes the shell. + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) + display.sleep(); + } + + // The IDataGenerator.shutdown() method is asynchronous, this requires + // using a query again in order to wait for its completion. + Query shutdownQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + generator.shutdown(rm); + } + }; + ImmediateExecutor.getInstance().execute(shutdownQuery); + try { + shutdownQuery.get(); + } catch (Exception e) {} + + // Shut down the display. + font.dispose(); + display.dispose(); + } + +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/AsyncDataViewer.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/AsyncDataViewer.java new file mode 100644 index 00000000000..8c8195595a9 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/AsyncDataViewer.java @@ -0,0 +1,272 @@ +/******************************************************************************* + * Copyright (c) 2006, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer.answers; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor; +import org.eclipse.dd.dsf.concurrent.ThreadSafe; +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.DsfExecutor; +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; +import org.eclipse.dd.dsf.concurrent.Query; +import org.eclipse.dd.dsf.ui.concurrent.DisplayDsfExecutor; +import org.eclipse.jface.viewers.ILazyContentProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Table; + +/** + * Data viewer based on a table, which reads data using asynchronous methods. + *

+ * This viewer implements the {@link ILazyContentProvider} interface + * which is used by the JFace TableViewer class to populate a Table. This + * interface contains separate asynchronous methods for requesting the count + * and values for individual indexes, which neatly correspond to the methods + * in {@link IDataGenerator}. As an added optimization, this viewer + * implementation checks for the range of visible items in the view upon each + * request, and it cancels old requests which scroll out of view but have not + * been completed yet. However, it is up to the data generator implementation + * to check the canceled state of the requests and ignore them. + *

+ */ +@ConfinedToDsfExecutor("fDisplayExecutor") +public class AsyncDataViewer + implements ILazyContentProvider, IDataGenerator.Listener +{ + // Executor to use instead of Display.asyncExec(). + @ThreadSafe + final private DsfExecutor fDisplayExecutor; + + // The viewer and generator that this content provider using. + final private TableViewer fViewer; + final private IDataGenerator fDataGenerator; + + // Fields used in request cancellation logic. + private List fItemDataRequestMonitors = new LinkedList(); + private Set fIndexesToCancel = new HashSet(); + private int fCancelCallsPending = 0; + + public AsyncDataViewer(TableViewer viewer, IDataGenerator generator) { + fViewer = viewer; + fDisplayExecutor = DisplayDsfExecutor.getDisplayDsfExecutor(fViewer.getTable().getDisplay()); + fDataGenerator = generator; + fDataGenerator.addListener(this); + } + + public void dispose() { + fDataGenerator.removeListener(this); + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + // Set the initial count to the viewer after the input is set. + queryItemCount(); + } + + public void updateElement(final int index) { + // Calculate the visible index range. + final int topIdx = fViewer.getTable().getTopIndex(); + final int botIdx = topIdx + getVisibleItemCount(topIdx); + + // Request the item for the given index. + queryValue(index); + + // Invoke a cancel task with a delay. The delay allows multiple cancel + // calls to be combined together improving performance of the viewer. + fCancelCallsPending++; + fDisplayExecutor.schedule( + new Runnable() { public void run() { + cancelStaleRequests(topIdx, botIdx); + }}, + 1, TimeUnit.MILLISECONDS); + } + + private int getVisibleItemCount(int top) { + Table table = fViewer.getTable(); + int itemCount = table.getItemCount(); + return Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - top); + } + + @ThreadSafe + public void countChanged() { + queryItemCount(); + } + + @ThreadSafe + public void valuesChanged(final Set indexes) { + // Mark the changed items in table viewer as dirty, this will + // trigger update requests for these indexes if they are + // visible in the viewer. + final TableViewer tableViewer = fViewer; + fDisplayExecutor.execute( new Runnable() { + public void run() { + if (!fViewer.getTable().isDisposed()) { + for (Integer index : indexes) { + tableViewer.clear(index); + } + } + }}); + } + + + private void queryItemCount() { + // Request count from data provider. When the count is returned, we + // have to re-dispatch into the display thread to avoid calling + // the table widget on the DSF dispatch thread. + fIndexesToCancel.clear(); + fDataGenerator.getCount( + // Use the display executor to construct the request monitor, this + // will cause the handleCompleted() method to be automatically + // called on the display thread. + new DataRequestMonitor(fDisplayExecutor, null) { + @Override + protected void handleCompleted() { + if (!fViewer.getTable().isDisposed()) { + fViewer.setItemCount(getData()); + fViewer.getTable().clearAll(); + } + } + }); + + } + + + // Dedicated class for data item requests. This class holds the index + // argument so it can be examined when canceling stale requests. + private class ValueDataRequestMonitor extends DataRequestMonitor { + + /** Index is used when canceling stale requests. */ + int fIndex; + + ValueDataRequestMonitor(int index) { + super(fDisplayExecutor, null); + fIndex = index; + } + + @Override + protected void handleCompleted() { + fItemDataRequestMonitors.remove(this); + + // Check if the request completed successfully, otherwise ignore it. + if (isSuccess()) { + if (!fViewer.getTable().isDisposed()) { + fViewer.replace(getData(), fIndex); + } + } + } + } + + private void queryValue(final int index) { + ValueDataRequestMonitor rm = new ValueDataRequestMonitor(index); + fItemDataRequestMonitors.add(rm); + fDataGenerator.getValue(index, rm); + } + + private void cancelStaleRequests(int topIdx, int botIdx) { + // Decrement the count of outstanding cancel calls. + fCancelCallsPending--; + + // Must check again, in case disposed while re-dispatching. + if (fDataGenerator == null || fViewer.getTable().isDisposed()) return; + + // Go through the outstanding requests and cancel any that + // are not visible anymore. + for (Iterator itr = fItemDataRequestMonitors.iterator(); itr.hasNext();) { + ValueDataRequestMonitor item = itr.next(); + if (item.fIndex < topIdx || item.fIndex > botIdx) { + // Set the item to canceled status, so that the data provider + // will ignore it. + item.cancel(); + + // Add the item index to list of indexes that were canceled, + // which will be sent to the table widget. + fIndexesToCancel.add(item.fIndex); + + // Remove the item from the outstanding cancel requests. + itr.remove(); + } + } + if (!fIndexesToCancel.isEmpty() && fCancelCallsPending == 0) { + Set canceledIdxs = fIndexesToCancel; + fIndexesToCancel = new HashSet(); + + // Clear the indexes of the canceled request, so that the + // viewer knows to request them again when needed. + // Note: clearing using TableViewer.clear(int) seems very + // inefficient, it's better to use Table.clear(int[]). + int[] canceledIdxsArray = new int[canceledIdxs.size()]; + int i = 0; + for (Integer index : canceledIdxs) { + canceledIdxsArray[i++] = index; + } + fViewer.getTable().clear(canceledIdxsArray); + } + } + + + public static void main(String[] args) { + // Create the shell to hold the viewer. + Display display = new Display(); + Shell shell = new Shell(display, SWT.SHELL_TRIM); + shell.setLayout(new GridLayout()); + GridData data = new GridData(GridData.FILL_BOTH); + shell.setLayoutData(data); + Font font = new Font(display, "Courier", 10, SWT.NORMAL); + + // Create the table viewer. + TableViewer tableViewer = new TableViewer(shell, SWT.BORDER | SWT.VIRTUAL); + tableViewer.getControl().setLayoutData(data); + + // Create the data generator. + final IDataGenerator generator = new DataGeneratorWithExecutor(); + + // Create the content provider which will populate the viewer. + AsyncDataViewer contentProvider = new AsyncDataViewer(tableViewer, generator); + tableViewer.setContentProvider(contentProvider); + tableViewer.setInput(new Object()); + + // Open the shell and service the display dispatch loop until user + // closes the shell. + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) + display.sleep(); + } + + // The IDataGenerator.shutdown() method is asynchronous, this requires + // using a query again in order to wait for its completion. + Query shutdownQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + generator.shutdown(rm); + } + }; + ImmediateExecutor.getInstance().execute(shutdownQuery); + try { + shutdownQuery.get(); + } catch (Exception e) {} + + // Shut down the display. + font.dispose(); + display.dispose(); + } +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/DataGeneratorWithExecutor.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/DataGeneratorWithExecutor.java new file mode 100644 index 00000000000..1c31a251d7c --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/DataGeneratorWithExecutor.java @@ -0,0 +1,311 @@ +/******************************************************************************* + * Copyright (c) 2006, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer.answers; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.TimeUnit; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.dd.dsf.concurrent.ConfinedToDsfExecutor; +import org.eclipse.dd.dsf.concurrent.Immutable; +import org.eclipse.dd.dsf.concurrent.ThreadSafe; +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.DefaultDsfExecutor; +import org.eclipse.dd.dsf.concurrent.DsfExecutor; +import org.eclipse.dd.dsf.concurrent.DsfRunnable; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; +import org.eclipse.dd.examples.dsf.DsfExamplesPlugin; + +/** + * DSF Executor-based implementation of the data generator. + *

+ * This generator uses a queue of client requests and processes these + * requests periodically using a DSF executor. The main feature of this + * generator is that it uses the executor as its only synchronization object. + * This means that all the fields with the exception of the executor can only + * be accessed while running in the executor thread. + *

+ */ +@ThreadSafe +public class DataGeneratorWithExecutor implements IDataGenerator { + + // Request objects are used to serialize the interface calls into objects + // which can then be pushed into a queue. + @Immutable + abstract class Request { + final RequestMonitor fRequestMonitor; + + Request(RequestMonitor rm) { + fRequestMonitor = rm; + } + } + + @Immutable + class CountRequest extends Request { + CountRequest(DataRequestMonitor rm) { + super(rm); + } + } + + @Immutable + class ItemRequest extends Request { + final int fIndex; + ItemRequest(int index, DataRequestMonitor rm) { + super(rm); + fIndex = index; + } + } + + // The executor used to access all internal data of the generator. + private DsfExecutor fExecutor; + + // Main request queue of the data generator. The getValue(), getCount(), + // and shutdown() methods write into the queue, while the serviceQueue() + // method reads from it. + // The executor used to access all internal data of the generator. + @ConfinedToDsfExecutor("fExecutor") + private List fQueue = new LinkedList(); + + // List of listeners is not synchronized, it also has to be accessed + // using the executor. + @ConfinedToDsfExecutor("fExecutor") + private List fListeners = new LinkedList(); + + // Current number of elements in this generator. + @ConfinedToDsfExecutor("fExecutor") + private int fCount = MIN_COUNT; + + // Counter used to determine when to reset the element count. + @ConfinedToDsfExecutor("fExecutor") + private int fCountResetTrigger = 0; + + // Elements which were modified since the last reset. + @ConfinedToDsfExecutor("fExecutor") + private Set fChangedIndexes = new HashSet(); + + // Flag used to ensure that requests are processed sequentially. + @ConfinedToDsfExecutor("fExecutor") + private boolean fServiceQueueInProgress = false; + + public DataGeneratorWithExecutor() { + // Create the executor + fExecutor = new DefaultDsfExecutor("Supplier Executor"); + + // Schedule a runnable to make the random changes. + fExecutor.scheduleAtFixedRate( + new DsfRunnable() { + public void run() { + randomChanges(); + } + }, + RANDOM_CHANGE_INTERVAL, + RANDOM_CHANGE_INTERVAL, + TimeUnit.MILLISECONDS); + } + + public void shutdown(final RequestMonitor rm) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + // Empty the queue of requests and fail them. + for (Request request : fQueue) { + request.fRequestMonitor.setStatus( + new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + request.fRequestMonitor.done(); + } + fQueue.clear(); + + // Kill executor. + fExecutor.shutdown(); + rm.done(); + } + }); + } catch (RejectedExecutionException e) { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void getCount(final DataRequestMonitor rm) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + fQueue.add(new CountRequest(rm)); + serviceQueue(); + } + }); + } catch (RejectedExecutionException e) { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void getValue(final int index, final DataRequestMonitor rm) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + fQueue.add(new ItemRequest(index, rm)); + serviceQueue(); + } + }); + } catch (RejectedExecutionException e) { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void addListener(final Listener listener) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + fListeners.add(listener); + } + }); + } catch (RejectedExecutionException e) {} + } + + public void removeListener(final Listener listener) { + try { + fExecutor.execute( new DsfRunnable() { + public void run() { + fListeners.remove(listener); + } + }); + } catch (RejectedExecutionException e) {} + } + + // Main processing function of this generator. + @ConfinedToDsfExecutor("fExecutor") + private void serviceQueue() { + + for (Iterator requestItr = fQueue.iterator(); requestItr.hasNext();) { + Request request = requestItr.next(); + if (request.fRequestMonitor.isCanceled()) { + request.fRequestMonitor.setStatus( + new Status(IStatus.CANCEL, DsfExamplesPlugin.PLUGIN_ID, "Request canceled")); + request.fRequestMonitor.done(); + requestItr.remove(); + } + } + + // If a queue servicing is already scheduled, do nothing. + if (fServiceQueueInProgress) { + return; + } + + if (fQueue.size() != 0) { + // If there are requests to service, remove one from the queue and + // schedule a runnable to process the request after a processing + // delay. + fServiceQueueInProgress = true; + final Request request = fQueue.remove(0); + fExecutor.schedule( + new DsfRunnable() { + public void run() { + if (request instanceof CountRequest) { + processCountRequest((CountRequest)request); + } else if (request instanceof ItemRequest) { + processItemRequest((ItemRequest)request); + } + + // Reset the processing flag and process next + // request. + fServiceQueueInProgress = false; + serviceQueue(); + } + }, + PROCESSING_DELAY, TimeUnit.MILLISECONDS); + } + } + + @ConfinedToDsfExecutor("fExecutor") + private void processCountRequest(CountRequest request) { + @SuppressWarnings("unchecked") // Suppress warning about lost type info. + DataRequestMonitor rm = (DataRequestMonitor)request.fRequestMonitor; + + rm.setData(fCount); + rm.done(); + } + + @ConfinedToDsfExecutor("fExecutor") + private void processItemRequest(ItemRequest request) { + @SuppressWarnings("unchecked") // Suppress warning about lost type info. + DataRequestMonitor rm = (DataRequestMonitor)request.fRequestMonitor; + + if (fChangedIndexes.contains(request.fIndex)) { + rm.setData("Changed: " + request.fIndex); + } else { + rm.setData(Integer.toString(request.fIndex)); + } + rm.done(); + } + + /** + * This method simulates changes in the supplier's data set. + */ + @ConfinedToDsfExecutor("fExecutor") + private void randomChanges() { + // Once every number of changes, reset the count, the rest of the + // times just change certain values. + if (++fCountResetTrigger % RANDOM_COUNT_CHANGE_INTERVALS == 0){ + randomCountReset(); + } else { + randomDataChange(); + } + } + + /** + * Calculates new size for provider's data set. + */ + @ConfinedToDsfExecutor("fExecutor") + private void randomCountReset() { + // Calculate the new count. + Random random = new java.util.Random(); + fCount = MIN_COUNT + Math.abs(random.nextInt()) % (MAX_COUNT - MIN_COUNT); + + // Reset the changed values. + fChangedIndexes.clear(); + + // Notify listeners + for (Listener listener : fListeners) { + listener.countChanged(); + } + } + + /** + * Invalidates a random range of indexes. + */ + @ConfinedToDsfExecutor("fExecutor") + private void randomDataChange() { + // Calculate the indexes to change. + Random random = new java.util.Random(); + Set set = new HashSet(); + for (int i = 0; i < fCount * RANDOM_CHANGE_SET_PERCENTAGE / 100; i++) { + set.add( new Integer(Math.abs(random.nextInt()) % fCount) ); + } + + // Add the indexes to an overall set of changed indexes. + fChangedIndexes.addAll(set); + + // Notify listeners + for (Listener listener : fListeners) { + listener.valuesChanged(set); + } + } +} + diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/DataGeneratorWithThread.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/DataGeneratorWithThread.java new file mode 100644 index 00000000000..25bab2d5bc9 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/DataGeneratorWithThread.java @@ -0,0 +1,238 @@ +/******************************************************************************* + * Copyright (c) 2006, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer.answers; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.ListenerList; +import org.eclipse.core.runtime.Status; +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; +import org.eclipse.dd.examples.dsf.DsfExamplesPlugin; + +/** + * Thread-based implementation of the data generator. + *

+ * This generator is based around a queue of client requests and a thread which + * reads the requests from the queue and processes them. The distinguishing + * feature of this generator is that it uses a a blocking queue as the main + * synchronization object. However, fListeners, fShutdown, and fChangedIndexes + * fields also need to be thread-safe and so they implement their own + * synchronization. + *

+ */ +public class DataGeneratorWithThread extends Thread implements IDataGenerator { + + // Request objects are used to serialize the interface calls into objects + // which can then be pushed into a queue. + abstract class Request { + final RequestMonitor fRequestMonitor; + + Request(RequestMonitor rm) { + fRequestMonitor = rm; + } + } + + class CountRequest extends Request { + CountRequest(DataRequestMonitor rm) { + super(rm); + } + } + + class ItemRequest extends Request { + final int fIndex; + ItemRequest(int index, DataRequestMonitor rm) { + super(rm); + fIndex = index; + } + } + + class ShutdownRequest extends Request { + ShutdownRequest(RequestMonitor rm) { + super(rm); + } + } + + // Main request queue of the data generator. The getValue(), getCount(), + // and shutdown() methods write into the queue, while the run() method + // reads from it. + private final BlockingQueue fQueue = new LinkedBlockingQueue(); + + // ListenerList class provides thread safety. + private ListenerList fListeners = new ListenerList(); + + // Current number of elements in this generator. + private int fCount = MIN_COUNT; + + // Counter used to determine when to reset the element count. + private int fCountResetTrigger = 0; + + // Elements which were modified since the last reset. + private Set fChangedIndexes = Collections.synchronizedSet(new HashSet()); + + // Used to determine when to make changes in data. + private long fLastChangeTime = System.currentTimeMillis(); + + // Flag indicating when the generator has been shut down. + private AtomicBoolean fShutdown = new AtomicBoolean(false); + + public DataGeneratorWithThread() { + // Immediately kick off the request processing thread. + start(); + } + + public void shutdown(RequestMonitor rm) { + // Mark the generator as shut down. After the fShutdown flag is set, + // all new requests should be shut down. + if (!fShutdown.getAndSet(true)) { + fQueue.add(new ShutdownRequest(rm)); + } else { + // + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void getCount(DataRequestMonitor rm) { + if (!fShutdown.get()) { + fQueue.add(new CountRequest(rm)); + } else { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void getValue(int index, DataRequestMonitor rm) { + if (!fShutdown.get()) { + fQueue.add(new ItemRequest(index, rm)); + } else { + rm.setStatus(new Status(IStatus.ERROR, DsfExamplesPlugin.PLUGIN_ID, "Supplier shut down")); + rm.done(); + } + } + + public void addListener(Listener listener) { + fListeners.add(listener); + } + + public void removeListener(Listener listener) { + fListeners.remove(listener); + } + + @Override + public void run() { + try { + while(true) { + // Get the next request from the queue. The time-out + // ensures that that the random changes get processed. + final Request request = fQueue.poll(100, TimeUnit.MILLISECONDS); + + // If a request was dequeued, process it. + if (request != null) { + // Simulate a processing delay. + Thread.sleep(PROCESSING_DELAY); + + if (request instanceof CountRequest) { + processCountRequest((CountRequest)request); + } else if (request instanceof ItemRequest) { + processItemRequest((ItemRequest)request); + } else if (request instanceof ShutdownRequest) { + // If shutting down, just break out of the while(true) + // loop and thread will exit. + request.fRequestMonitor.done(); + break; + } + } + + // Simulate data changes. + randomChanges(); + } + } + catch (InterruptedException x) {} + } + + private void processCountRequest(CountRequest request) { + @SuppressWarnings("unchecked") // Suppress warning about lost type info. + DataRequestMonitor rm = (DataRequestMonitor)request.fRequestMonitor; + + rm.setData(fCount); + rm.done(); + } + + private void processItemRequest(ItemRequest request) { + @SuppressWarnings("unchecked") // Suppress warning about lost type info. + DataRequestMonitor rm = (DataRequestMonitor)request.fRequestMonitor; + + if (fChangedIndexes.contains(request.fIndex)) { + rm.setData("Changed: " + request.fIndex); + } else { + rm.setData(Integer.toString(request.fIndex)); + } + rm.done(); + } + + + private void randomChanges() { + // Check if enough time is elapsed. + if (System.currentTimeMillis() > fLastChangeTime + RANDOM_CHANGE_INTERVAL) { + fLastChangeTime = System.currentTimeMillis(); + + // Once every number of changes, reset the count, the rest of the + // times just change certain values. + if (++fCountResetTrigger % RANDOM_COUNT_CHANGE_INTERVALS == 0){ + randomCountReset(); + } else { + randomDataChange(); + } + } + } + + private void randomCountReset() { + // Calculate the new count. + Random random = new java.util.Random(); + fCount = MIN_COUNT + Math.abs(random.nextInt()) % (MAX_COUNT - MIN_COUNT); + + // Reset the changed values. + fChangedIndexes.clear(); + + // Notify listeners + for (Object listener : fListeners.getListeners()) { + ((Listener)listener).countChanged(); + } + } + + private void randomDataChange() { + // Calculate the indexes to change. + Random random = new java.util.Random(); + Set set = new HashSet(); + for (int i = 0; i < fCount * RANDOM_CHANGE_SET_PERCENTAGE / 100; i++) { + set.add( new Integer(Math.abs(random.nextInt()) % fCount) ); + } + + // Add the indexes to an overall set of changed indexes. + fChangedIndexes.addAll(set); + + // Notify listeners + for (Object listener : fListeners.getListeners()) { + ((Listener)listener).valuesChanged(set); + } + } +} + + diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/IDataGenerator.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/IDataGenerator.java new file mode 100644 index 00000000000..eb8348f8848 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/IDataGenerator.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2006, 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer.answers; + +import java.util.Set; + +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; +import org.eclipse.dd.dsf.concurrent.ThreadSafe; + +/** + * Data generator is simple source of data used to populate the example table + * view. It contains two asynchronous methods for retrieving the data + * parameters: the count and the value for a given index. It also allows the + * view to receive events indicating when the data supplied by the generator + * is changed. + */ +@ThreadSafe +public interface IDataGenerator { + + // Constants which control the data generator behavior. + // Changing the count range can stress the scalability of the system, while + // changing of the process delay and random change interval can stress + // its performance. + final static int MIN_COUNT = 100; + final static int MAX_COUNT = 200; + final static int PROCESSING_DELAY = 10; + final static int RANDOM_CHANGE_INTERVAL = 10000; + final static int RANDOM_COUNT_CHANGE_INTERVALS = 3; + final static int RANDOM_CHANGE_SET_PERCENTAGE = 10; + + + // Listener interface that the view needs to implement to react + // to the changes in data. + public interface Listener { + void countChanged(); + void valuesChanged(Set indexes); + } + + // Data access methods. + void getCount(DataRequestMonitor rm); + void getValue(int index, DataRequestMonitor rm); + + // Method used to shutdown the data generator including any threads that + // it may use. + void shutdown(RequestMonitor rm); + + // Methods for registering change listeners. + void addListener(Listener listener); + void removeListener(Listener listener); +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/SyncDataViewer.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/SyncDataViewer.java new file mode 100644 index 00000000000..ef442cb2a9d --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/dataviewer/answers/SyncDataViewer.java @@ -0,0 +1,182 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.dataviewer.answers; + +import java.util.Set; + +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; +import org.eclipse.dd.dsf.concurrent.Query; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +/** + * Data viewer based on a table, which reads data using synchronous methods. + *

+ * This viewer implements the {@link IStructuredContentProvider} interface + * which is used by the JFace TableViewer class to populate a Table. This + * interface contains one principal methods for reading data {@link #getElements(Object)}, + * which synchronously returns an array of elements. In order to implement this + * method using the asynchronous data generator, this provider uses the + * {@link Query} object. + *

+ */ +public class SyncDataViewer + implements IStructuredContentProvider, IDataGenerator.Listener +{ + // The viewer and generator that this content provider using. + final private TableViewer fViewer; + final private IDataGenerator fDataGenerator; + + public SyncDataViewer(TableViewer viewer, IDataGenerator generator) { + fViewer = viewer; + fDataGenerator = generator; + fDataGenerator.addListener(this); + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + // Not used + } + + + public Object[] getElements(Object inputElement) { + + // Create the query object for reading data count. + Query countQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fDataGenerator.getCount(rm); + } + }; + + // Submit the query to be executed. A query implements a runnable + // interface and it has to be executed in order to do its work. + ImmediateExecutor.getInstance().execute(countQuery); + int count = 0; + + // Block until the query completes, which will happen when the request + // monitor of the execute() method is marked done. + try { + count = countQuery.get(); + } catch (Exception e) { + // InterruptedException and ExecutionException can be thrown here. + // ExecutionException containing a CoreException will be thrown + // if an error status is set to the Query's request monitor. + return new Object[0]; + } + + // Create the array that will be filled with elements. + // For each index in the array execute a query to get the element at + // that index. + final Object[] elements = new Object[count]; + + for (int i = 0; i < count; i++) { + final int index = i; + Query valueQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fDataGenerator.getValue(index, rm); + } + }; + ImmediateExecutor.getInstance().execute(valueQuery); + try { + elements[i] = valueQuery.get(); + } catch (Exception e) { + elements[i] = "error"; + } + } + return elements; + } + + public void dispose() { + fDataGenerator.removeListener(this); + } + + public void countChanged() { + // For any event from the generator, refresh the whole viewer. + refreshViewer(); + } + + public void valuesChanged(Set indexes) { + // For any event from the generator, refresh the whole viewer. + refreshViewer(); + } + + private void refreshViewer() { + getElements(null); + + // This method may be called on any thread, switch to the display + // thread before calling the viewer. + Display display = fViewer.getControl().getDisplay(); + display.asyncExec( new Runnable() { + public void run() { + if (!fViewer.getControl().isDisposed()) { + fViewer.refresh(); + } + } + }); + } + + public static void main(String[] args) { + // Create the shell to hold the viewer. + Display display = new Display(); + Shell shell = new Shell(display, SWT.SHELL_TRIM); + shell.setLayout(new GridLayout()); + GridData data = new GridData(GridData.FILL_BOTH); + shell.setLayoutData(data); + Font font = new Font(display, "Courier", 10, SWT.NORMAL); + + // Create the table viewer. + TableViewer tableViewer = new TableViewer(shell, SWT.BORDER); + tableViewer.getControl().setLayoutData(data); + + // Create the data generator. + final IDataGenerator generator = new DataGeneratorWithExecutor(); + + // Create the content provider which will populate the viewer. + SyncDataViewer contentProvider = new SyncDataViewer(tableViewer, generator); + tableViewer.setContentProvider(contentProvider); + tableViewer.setInput(new Object()); + + // Open the shell and service the display dispatch loop until user + // closes the shell. + shell.open(); + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) + display.sleep(); + } + + // The IDataGenerator.shutdown() method is asynchronous, this requires + // using a query again in order to wait for its completion. + Query shutdownQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + generator.shutdown(rm); + } + }; + ImmediateExecutor.getInstance().execute(shutdownQuery); + try { + shutdownQuery.get(); + } catch (Exception e) {} + + // Shut down the display. + font.dispose(); + display.dispose(); + } + +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/Async2Plus2.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/Async2Plus2.java new file mode 100644 index 00000000000..6fa56cb19c4 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/Async2Plus2.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.requestmonitor; + +import java.util.concurrent.Executor; + +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; + +/** + * Example of using a DataRequestMonitor to retrieve a result from an + * asynchronous method. + */ +public class Async2Plus2 { + + public static void main(String[] args) { + Executor executor = ImmediateExecutor.getInstance(); + DataRequestMonitor rm = + new DataRequestMonitor(executor, null) { + @Override + protected void handleCompleted() { + System.out.println("2 + 2 = " + getData()); + } + }; + asyncAdd(2, 2, rm); + } + + static void asyncAdd(int value1, int value2, DataRequestMonitor rm) { + rm.setData(value1 + value2); + rm.done(); + } +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/AsyncHelloWorld.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/AsyncHelloWorld.java new file mode 100644 index 00000000000..293c0b399f8 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/AsyncHelloWorld.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.requestmonitor; + +import java.util.concurrent.Executor; + +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; + +/** + * "Hello world" example which uses an asynchronous method to print out + * the result. + *

+ * The main method uses an immediate executor, which executes runnables + * as soon as they are submitted, in creating its request monitor. + * + */ +public class AsyncHelloWorld { + + public static void main(String[] args) { + Executor executor = ImmediateExecutor.getInstance(); + RequestMonitor rm = new RequestMonitor(executor, null); + asyncHelloWorld(rm); + } + + static void asyncHelloWorld(RequestMonitor rm) { + System.out.println("Hello world"); + // TODO Exercise 1: - Call the second async. "Hello world 2" method. + // Hint: Calling an asynchronous method requires passing to it a + // request monitor. A new request monitor can be constructed with + // a parent RequestMonitor as an argument argument. The parent gets + // completed automatically when the lower level request monitor is + // completed. + rm.done(); + } + + // TODO: Exercise 1 - Add a second async. "Hello world 2" method. +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/AsyncQuicksort.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/AsyncQuicksort.java new file mode 100644 index 00000000000..f6b6a16e86b --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/AsyncQuicksort.java @@ -0,0 +1,111 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.requestmonitor; + +import java.util.Arrays; +import java.util.concurrent.Executor; + +import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor; +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; + +/** + * Example of using a CountingRequestMonitor to wait for multiple + * asynchronous calls to complete. + */ +public class AsyncQuicksort { + + static Executor fgExecutor = ImmediateExecutor.getInstance(); + + public static void main(String[] args) { + final int[] array = {5, 7, 8, 3, 2, 1, 9, 5, 4}; + + System.out.println("To sort: " + Arrays.toString(array)); + asyncQuicksort( + array, 0, array.length - 1, + new RequestMonitor(fgExecutor, null) { + @Override + protected void handleCompleted() { + System.out.println("Sorted: " + Arrays.toString(array)); + } + }); + } + + static void asyncQuicksort(final int[] array, final int left, + final int right, final RequestMonitor rm) + { + if (right > left) { + int pivot = left; + // TODO: Exercise 2 - Convert the call to partition into an + // asynchronous call to asyncPartition(). + // Hint: The rest of the code below should be executed inside + // the DataRequestMonitor.handleCompleted() overriding method. + int newPivot = partition(array, left, right, pivot); + printArray(array, left, right, newPivot); + + CountingRequestMonitor countingRm = new CountingRequestMonitor(fgExecutor, rm); + asyncQuicksort(array, left, newPivot - 1, countingRm); + asyncQuicksort(array, newPivot + 1, right, countingRm); + countingRm.setDoneCount(2); + } else { + rm.done(); + } + } + + // TODO Exercise 2 - Convert partition to an asynchronous method. + // Hint: a DataRequestMonitor should be used to carry the + // return value to the caller. + static int partition(int[] array, int left, int right, int pivot) + { + int pivotValue = array[pivot]; + array[pivot] = array[right]; + array[right] = pivotValue; + int store = left; + for (int i = left; i < right; i++) { + if (array[i] <= pivotValue) { + int tmp = array[store]; + array[store] = array[i]; + array[i] = tmp; + store++; + } + } + array[right] = array[store]; + array[store] = pivotValue; + + // TODO: Request Monitors Exercise 2 - Return the data to caller using + // a request monitor. + return store; + } + + static void printArray(int[] array, int left, int right, int pivot) { + StringBuffer buffer = new StringBuffer(); + for (int i = 0; i < array.length; i++ ) { + if (i == left) { + buffer.append('>'); + } else if (i == pivot) { + buffer.append('-'); + } else { + buffer.append(' '); + } + buffer.append(array[i]); + + if (i == right) { + buffer.append('<'); + } else if (i == pivot) { + buffer.append('-'); + } else { + buffer.append(' '); + } + } + + System.out.println(buffer); + } +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/Async2Plus2.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/Async2Plus2.java new file mode 100644 index 00000000000..d775c0c1e1e --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/Async2Plus2.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.requestmonitor.answers; + +import java.util.concurrent.Executor; + +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; + +/** + * Example of using a DataRequestMonitor to retrieve a result from an + * asynchronous method. + */ +public class Async2Plus2 { + + public static void main(String[] args) { + Executor executor = ImmediateExecutor.getInstance(); + DataRequestMonitor rm = + new DataRequestMonitor(executor, null) { + @Override + protected void handleCompleted() { + System.out.println("2 + 2 = " + getData()); + } + }; + asyncAdd(2, 2, rm); + } + + static void asyncAdd(int value1, int value2, DataRequestMonitor rm) { + rm.setData(value1 + value2); + rm.done(); + } +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/AsyncHelloWorld.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/AsyncHelloWorld.java new file mode 100644 index 00000000000..89061748a35 --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/AsyncHelloWorld.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.requestmonitor.answers; + +import java.util.concurrent.Executor; + +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; + +/** + * "Hello world" example which uses an asynchronous method to print out + * the result. + *

+ * The main method uses an immediate executor, which executes runnables + * as soon as they are submitted, in creating its request monitor. + * + */ +public class AsyncHelloWorld { + + public static void main(String[] args) { + Executor executor = ImmediateExecutor.getInstance(); + RequestMonitor rm = new RequestMonitor(executor, null); + asyncHelloWorld(rm); + } + + static void asyncHelloWorld(RequestMonitor rm) { + System.out.println("Hello world"); + RequestMonitor rm2 = new RequestMonitor(ImmediateExecutor.getInstance(), rm); + asyncHelloWorld2(rm2); + } + + static void asyncHelloWorld2(RequestMonitor rm) { + System.out.println("Hello world 2"); + rm.done(); + } +} diff --git a/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/AsyncQuicksort.java b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/AsyncQuicksort.java new file mode 100644 index 00000000000..10b510d389d --- /dev/null +++ b/plugins/org.eclipse.dd.examples.dsf/src/org/eclipse/dd/examples/dsf/requestmonitor/answers/AsyncQuicksort.java @@ -0,0 +1,113 @@ +/******************************************************************************* + * Copyright (c) 2008 Wind River Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ +package org.eclipse.dd.examples.dsf.requestmonitor.answers; + +import java.util.Arrays; +import java.util.concurrent.Executor; + +import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor; +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.ImmediateExecutor; +import org.eclipse.dd.dsf.concurrent.RequestMonitor; + +/** + * Example of using a CountingRequestMonitor to wait for multiple + * asynchronous calls to complete. + */ +public class AsyncQuicksort { + + static Executor fgExecutor = ImmediateExecutor.getInstance(); + + public static void main(String[] args) { + final int[] array = {5, 7, 8, 3, 2, 1, 9, 5, 4}; + + System.out.println("To sort: " + Arrays.toString(array)); + asyncQuicksort( + array, 0, array.length - 1, + new RequestMonitor(fgExecutor, null) { + @Override + protected void handleCompleted() { + System.out.println("Sorted: " + Arrays.toString(array)); + } + }); + } + + static void asyncQuicksort(final int[] array, final int left, + final int right, final RequestMonitor rm) + { + if (right > left) { + int pivot = left; + asyncPartition( + array, left, right, pivot, + new DataRequestMonitor(fgExecutor, rm) { + @Override + protected void handleCompleted() { + int newPivot = getData(); + printArray(array, left, right, newPivot); + + CountingRequestMonitor countingRm = new CountingRequestMonitor(fgExecutor, rm); + asyncQuicksort(array, left, newPivot - 1, countingRm); + asyncQuicksort(array, newPivot + 1, right, countingRm); + countingRm.setDoneCount(2); + } + }); + } else { + rm.done(); + } + } + + static void asyncPartition(int[] array, int left, int right, int pivot, DataRequestMonitor rm) + { + int pivotValue = array[pivot]; + array[pivot] = array[right]; + array[right] = pivotValue; + int store = left; + for (int i = left; i < right; i++) { + if (array[i] <= pivotValue) { + int tmp = array[store]; + array[store] = array[i]; + array[i] = tmp; + store++; + } + } + array[right] = array[store]; + array[store] = pivotValue; + + // Java 5 automatically converts the int type of the store variable + // to an Integer object. + rm.setData(store); + rm.done(); + } + + static void printArray(int[] array, int left, int right, int pivot) { + StringBuffer buffer = new StringBuffer(); + for (int i = 0; i < array.length; i++ ) { + if (i == left) { + buffer.append('>'); + } else if (i == pivot) { + buffer.append('-'); + } else { + buffer.append(' '); + } + buffer.append(array[i]); + + if (i == right) { + buffer.append('<'); + } else if (i == pivot) { + buffer.append('-'); + } else { + buffer.append(' '); + } + } + + System.out.println(buffer); + } +} diff --git a/plugins/org.eclipse.dd.gdb.launch/.project b/plugins/org.eclipse.dd.gdb.launch/.project index 116145f8919..74e3da1f4f2 100644 --- a/plugins/org.eclipse.dd.gdb.launch/.project +++ b/plugins/org.eclipse.dd.gdb.launch/.project @@ -20,9 +20,15 @@ + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/plugins/org.eclipse.dd.gdb.ui/.project b/plugins/org.eclipse.dd.gdb.ui/.project index 82e21a8083e..7c971e17264 100644 --- a/plugins/org.eclipse.dd.gdb.ui/.project +++ b/plugins/org.eclipse.dd.gdb.ui/.project @@ -20,9 +20,15 @@ + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/plugins/org.eclipse.dd.gdb.ui/.settings/.api_filters b/plugins/org.eclipse.dd.gdb.ui/.settings/.api_filters new file mode 100644 index 00000000000..43960e7d831 --- /dev/null +++ b/plugins/org.eclipse.dd.gdb.ui/.settings/.api_filters @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/org.eclipse.dd.gdb.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.dd.gdb.ui/META-INF/MANIFEST.MF index b17177c2a90..410a99325f2 100644 --- a/plugins/org.eclipse.dd.gdb.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.dd.gdb.ui/META-INF/MANIFEST.MF @@ -23,4 +23,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.variables Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.dd.gdb.internal.ui.launching +Export-Package: org.eclipse.dd.gdb.internal.ui.actions;x-internal:=true, + org.eclipse.dd.gdb.internal.ui.breakpoints;x-internal:=true, + org.eclipse.dd.gdb.internal.ui.launching;x-internal:=true, + org.eclipse.dd.gdb.internal.ui.viewmodel;x-internal:=true, + org.eclipse.dd.gdb.internal.ui.viewmodel.launch;x-internal:=true diff --git a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/actions/GdbConnectCommand.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/actions/GdbConnectCommand.java index cbd45108219..4061509488f 100644 --- a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/actions/GdbConnectCommand.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/actions/GdbConnectCommand.java @@ -39,7 +39,6 @@ import org.eclipse.dd.gdb.internal.provisional.actions.IConnect; import org.eclipse.dd.gdb.internal.provisional.launching.LaunchMessages; import org.eclipse.dd.gdb.internal.ui.GdbUIPlugin; import org.eclipse.dd.mi.service.IMIProcesses; -import org.eclipse.dd.mi.service.ProcessInfo; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.IStatusHandler; diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/ProcessInfo.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/actions/ProcessInfo.java similarity index 92% rename from plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/ProcessInfo.java rename to plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/actions/ProcessInfo.java index d9d48ccd157..000c11778d1 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/ProcessInfo.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/actions/ProcessInfo.java @@ -8,13 +8,13 @@ * Contributors: * Ericsson - initial API and implementation *******************************************************************************/ -package org.eclipse.dd.mi.service; +package org.eclipse.dd.gdb.internal.ui.actions; import org.eclipse.cdt.core.IProcessInfo; import org.eclipse.dd.dsf.concurrent.Immutable; @Immutable -public class ProcessInfo implements IProcessInfo, Comparable { +class ProcessInfo implements IProcessInfo, Comparable { private final int pid; private final String name; diff --git a/plugins/org.eclipse.dd.gdb/.project b/plugins/org.eclipse.dd.gdb/.project index 5d4f83fccd0..30f9493dc84 100644 --- a/plugins/org.eclipse.dd.gdb/.project +++ b/plugins/org.eclipse.dd.gdb/.project @@ -20,9 +20,15 @@ + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/plugins/org.eclipse.dd.gdb/.settings/.api_filters b/plugins/org.eclipse.dd.gdb/.settings/.api_filters new file mode 100644 index 00000000000..c1e2c50ccbb --- /dev/null +++ b/plugins/org.eclipse.dd.gdb/.settings/.api_filters @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/org.eclipse.dd.gdb/META-INF/MANIFEST.MF b/plugins/org.eclipse.dd.gdb/META-INF/MANIFEST.MF index 694df39b150..d160167edbf 100644 --- a/plugins/org.eclipse.dd.gdb/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.dd.gdb/META-INF/MANIFEST.MF @@ -15,9 +15,9 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.variables Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.dd.gdb.internal.provisional, - org.eclipse.dd.gdb.internal.provisional.actions, - org.eclipse.dd.gdb.internal.provisional.breakpoints, - org.eclipse.dd.gdb.internal.provisional.launching, - org.eclipse.dd.gdb.internal.provisional.service, - org.eclipse.dd.gdb.internal.provisional.service.command +Export-Package: org.eclipse.dd.gdb.internal.provisional;x-internal:=true, + org.eclipse.dd.gdb.internal.provisional.actions;x-internal:=true, + org.eclipse.dd.gdb.internal.provisional.breakpoints;x-internal:=true, + org.eclipse.dd.gdb.internal.provisional.launching;x-internal:=true, + org.eclipse.dd.gdb.internal.provisional.service;x-internal:=true, + org.eclipse.dd.gdb.internal.provisional.service.command;x-internal:=true diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java index 7f49c530a27..dcc1098a9bc 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/IGDBLaunchConfigurationConstants.java @@ -51,6 +51,7 @@ public class IGDBLaunchConfigurationConstants { /** * Launch configuration attribute key. Boolean value to set the non-stop mode * Debuger/gdb/MI property. + * @since 1.1 */ public static final String ATTR_DEBUGGER_NON_STOP = GdbPlugin.PLUGIN_ID + ".NON_STOP"; //$NON-NLS-1$ @@ -66,6 +67,7 @@ public class IGDBLaunchConfigurationConstants { /** * Launch configuration attribute key. Boolean value to set the 'use shared library symbols for application' flag of the debugger. + * @since 1.1 */ public static final String ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP = GdbPlugin.PLUGIN_ID + ".USE_SOLIB_SYMBOLS_FOR_APP"; //$NON-NLS-1$ @@ -91,6 +93,7 @@ public class IGDBLaunchConfigurationConstants { /** * Launch configuration attribute value. The key is ATTR_DEBUGGER_NON_STOP. + * @since 1.1 */ public static final boolean DEBUGGER_NON_STOP_DEFAULT = false; @@ -106,6 +109,7 @@ public class IGDBLaunchConfigurationConstants { /** * Launch configuration attribute value. The key is ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP. + * @since 1.1 */ public static final boolean DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT = false; diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/actions/IConnect.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/actions/IConnect.java index 766aee60f0d..3f6bea3ca1a 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/actions/IConnect.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/actions/IConnect.java @@ -12,6 +12,9 @@ package org.eclipse.dd.gdb.internal.provisional.actions; import org.eclipse.dd.dsf.concurrent.RequestMonitor; +/** + * @since 1.1 + */ public interface IConnect { /** * Returns whether this element can currently attempt to diff --git a/plugins/org.eclipse.dd.mi/.project b/plugins/org.eclipse.dd.mi/.project index 30d6696665e..d108e3dcfab 100644 --- a/plugins/org.eclipse.dd.mi/.project +++ b/plugins/org.eclipse.dd.mi/.project @@ -20,9 +20,15 @@ + + org.eclipse.pde.api.tools.apiAnalysisBuilder + + + org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature + org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/plugins/org.eclipse.dd.mi/META-INF/MANIFEST.MF b/plugins/org.eclipse.dd.mi/META-INF/MANIFEST.MF index e004e0ad24b..4e02f3bef82 100644 --- a/plugins/org.eclipse.dd.mi/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.dd.mi/META-INF/MANIFEST.MF @@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.cdt.debug.core, org.eclipse.cdt.core Export-Package: - org.eclipse.dd.mi.internal, + org.eclipse.dd.mi.internal;x-internal:=true, org.eclipse.dd.mi.service, org.eclipse.dd.mi.service.command, org.eclipse.dd.mi.service.command.commands, diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/ExpressionService.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/ExpressionService.java index c38b68a04ad..2c48aed4470 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/ExpressionService.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/ExpressionService.java @@ -913,6 +913,10 @@ public class ExpressionService extends AbstractDsfService implements IExpression // MIVariableManager separately traps this event } + /** + * {@inheritDoc} + * @since 1.1 + */ public void flushCache(IDMContext context) { fExpressionCache.reset(context); // We must also mark all variable objects as out-of-date diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIExecutionGroupDMContext.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIExecutionGroupDMContext.java index 5e70be36864..d0c1aafab61 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIExecutionGroupDMContext.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIExecutionGroupDMContext.java @@ -15,6 +15,7 @@ import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext; /** * An execution group context object. In the GDB/MI protocol, thread groups * are represented by a string identifier, which is the basis for this context. + * @since 1.1 */ public interface IMIExecutionGroupDMContext extends IContainerDMContext { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcessDMContext.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcessDMContext.java index 2a1252b00a7..e1584d77501 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcessDMContext.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcessDMContext.java @@ -15,6 +15,7 @@ import org.eclipse.dd.dsf.debug.service.IProcesses.IProcessDMContext; /** * A process context object. In the GDB/MI protocol, processes are represented * by an string identifier, which is the basis for this context. + * @since 1.1 */ public interface IMIProcessDMContext extends IProcessDMContext { /** diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcesses.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcesses.java index 88d5ef47df1..dadb757b9c7 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcesses.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/IMIProcesses.java @@ -16,6 +16,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC /** * This interface provides a method for creating execution contexts. + * @since 1.1 */ public interface IMIProcesses extends IProcesses { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpoints.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpoints.java index e0a7f736195..d81c068b023 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpoints.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpoints.java @@ -254,14 +254,16 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints // IServiceEventListener /////////////////////////////////////////////////////////////////////////// - /* - * When a watchpoint goes out of scope, it is automatically removed from - * the back-end. To keep our internal state synchronized, we have to - * remove it from our breakpoints map. - */ + /** + * This method is left for API compatibility only. + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(MIWatchpointScopeEvent e) { - // PP: + // When a watchpoint goes out of scope, it is automatically removed from + // the back-end. To keep our internal state synchronized, we have to + // remove it from our breakpoints map. IBreakpointsTargetDMContext bpContext = DMContexts.getAncestorOfType(e.getDMContext(), IBreakpointsTargetDMContext.class); if (bpContext != null) { Map contextBps = fBreakpoints.get(bpContext); @@ -271,11 +273,21 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints } } - // Not used, kept for API compatibility. ICommandControlShutdownDMEvent is used instead + /** + * This method is left for API compatibility only. + * ICommandControlShutdownDMEvent is used instead + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(MIGDBExitEvent e) { } + /** + * @since 1.1 + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ICommandControlShutdownDMEvent e) { } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpointsManager.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpointsManager.java index 8914d8af99f..cc5838b3180 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpointsManager.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIBreakpointsManager.java @@ -1228,12 +1228,23 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo // Session exit //------------------------------------------------------------------------- - // Not used, kept for API compatibility. ICommandControlShutdownDMEvent is used instead + // Not used, kept for API compatibility. + /** + * This method is left for API compatibility only. + * ICommandControlShutdownDMEvent is used instead. + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(MIGDBExitEvent e) { terminated(); } + /** + * @since 1.1 + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ICommandControlShutdownDMEvent e) { // bug 243899: The call to terminate results in an exception, diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIMemory.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIMemory.java index 04e4a35fe36..bef7259c976 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIMemory.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIMemory.java @@ -274,6 +274,10 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer // Event handlers ////////////////////////////////////////////////////////////////////////// + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(IRunControl.IContainerResumedDMEvent e) { fMemoryCache.setTargetAvailable(e.getDMContext(), false); @@ -282,12 +286,20 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer } } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(IRunControl.IContainerSuspendedDMEvent e) { fMemoryCache.setTargetAvailable(e.getDMContext(), true); fMemoryCache.reset(); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ExpressionChangedEvent e) { @@ -319,6 +331,24 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer } } + /** + * This method is left for API compatibility only. + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ + @DsfServiceEventHandler + public void eventDispatched(IRunControl.IResumedDMEvent e) { + } + + /** + * This method is left for API compatibility only. + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ + @DsfServiceEventHandler + public void eventDispatched(IRunControl.ISuspendedDMEvent e) { + } + /////////////////////////////////////////////////////////////////////////// // SortedLinkedlist /////////////////////////////////////////////////////////////////////////// @@ -907,6 +937,10 @@ public class MIMemory extends AbstractDsfService implements IMemory, ICachingSer } + /** + * {@inheritDoc} + * @since 1.1 + */ public void flushCache(IDMContext context) { fMemoryCache.reset(); } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIModules.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIModules.java index 8e413abd43c..d1fd4589271 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIModules.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIModules.java @@ -218,6 +218,10 @@ public class MIModules extends AbstractDsfService implements IModules, ICachingS rm.done(); } + /** + * {@inheritDoc} + * @since 1.1 + */ public void flushCache(IDMContext context) { fModulesCache.reset(); } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIProcesses.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIProcesses.java index b25ef9da2dd..01bc6c16d8b 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIProcesses.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIProcesses.java @@ -45,6 +45,9 @@ import org.eclipse.dd.mi.service.command.output.MIThreadListIdsInfo; import org.osgi.framework.BundleContext; +/** + * @since 1.1 + */ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICachingService { // Below is the context hierarchy that is implemented between the @@ -606,6 +609,10 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa rm.done(); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(IResumedDMEvent e) { if (e instanceof IContainerResumedDMEvent) { @@ -618,6 +625,10 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ISuspendedDMEvent e) { if (e instanceof IContainerSuspendedDMEvent) { @@ -628,13 +639,19 @@ public class MIProcesses extends AbstractDsfService implements IMIProcesses, ICa } } - // Event handler when a thread starts + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(IStartedDMEvent e) { fContainerCommandCache.reset(); } - // Event handler when a thread exits + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(IExitedDMEvent e) { fContainerCommandCache.reset(); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRegisters.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRegisters.java index 5cb2f6e779b..2efbebb6a2b 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRegisters.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRegisters.java @@ -399,6 +399,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach * need to be flushed. These handlers maintain the state of the caches. */ + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(IRunControl.IResumedDMEvent e) { fRegisterValueCache.setContextAvailable(e.getDMContext(), false); @@ -407,6 +411,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach } } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched( IRunControl.ISuspendedDMEvent e) { @@ -414,6 +422,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach fRegisterValueCache.reset(); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final IRegisters.IRegisterChangedDMEvent e) { fRegisterValueCache.reset(); @@ -623,6 +635,10 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach rm.done(); } + /** + * {@inheritDoc} + * @since 1.1 + */ public void flushCache(IDMContext context) { fRegisterNameCache.reset(context); fRegisterValueCache.reset(context); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java index 95a1470735b..028cd46d4b5 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java @@ -321,9 +321,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa return new MIExecutionDMC(getSession().getId(), container, threadId); } - // - // Running event handling - // + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final MIRunningEvent e) { IDMEvent event = null; @@ -339,9 +340,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa getSession().dispatchEvent(event, getProperties()); } - // - // Suspended event handling - // + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final MIStoppedEvent e) { IDMEvent event = null; @@ -357,10 +359,12 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa getSession().dispatchEvent(event, getProperties()); } - // - // Thread Created event handling - // When a new thread is created - OOB Event fired ~"[New Thread 1077300144 (LWP 7973)]\n" - // + /** + * Thread Created event handling + * When a new thread is created - OOB Event fired ~"[New Thread 1077300144 (LWP 7973)]\n" + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final MIThreadCreatedEvent e) { IContainerDMContext containerDmc = e.getDMContext(); @@ -368,10 +372,12 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa getSession().dispatchEvent(new StartedDMEvent(executionCtx, e), getProperties()); } - // - // Thread exit event handling - // When a new thread is destroyed - OOB Event fired " - // + /** + * Thread exit event handling + * When a new thread is destroyed - OOB Event fired " + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final MIThreadExitEvent e) { IContainerDMContext containerDmc = e.getDMContext(); @@ -379,6 +385,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa getSession().dispatchEvent(new ExitedDMEvent(executionCtx, e), getProperties()); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ContainerResumedEvent e) { fSuspended = false; @@ -393,7 +403,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa } } - + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ContainerSuspendedEvent e) { fMICommandCache.setContextAvailable(e.getDMContext(), true); @@ -405,25 +418,42 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa fStepping = false; } - // Not used, kept for API compatibility. ICommandControlShutdownDMEvent is used instead + /** + * Not used, kept for API compatibility. ICommandControlShutdownDMEvent is used instead + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(MIGDBExitEvent e) { fTerminated = true; } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + * @since 1.1 + */ @DsfServiceEventHandler public void eventDispatched(ICommandControlShutdownDMEvent e) { fTerminated = true; } - // Event handler when New thread is created + /** + * Event handler when New thread is created + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(StartedDMEvent e) { } - // Event handler when a thread is destroyed + /** + * Event handler when a thread is destroyed + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ExitedDMEvent e) { fMICommandCache.reset(e.getDMContext()); @@ -645,12 +675,13 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa rm.done(); } - /* + /** * Run selected execution thread to a given line number. */ - // Later add support for Address and function. - // skipBreakpoints is not used at the moment. Implement later public void runToLine(IExecutionDMContext context, String fileName, String lineNo, boolean skipBreakpoints, final DataRequestMonitor rm){ + // Later add support for Address and function. + // skipBreakpoints is not used at the moment. Implement later + assert context != null; IMIExecutionDMContext dmc = DMContexts.getAncestorOfType(context, IMIExecutionDMContext.class); @@ -678,6 +709,10 @@ public class MIRunControl extends AbstractDsfService implements IRunControl, ICa } } + /** + * {@inheritDoc} + * @since 1.1 + */ public void flushCache(IDMContext context) { fMICommandCache.reset(context); } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControlNS.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControlNS.java index 78a8343e367..954d93fd6ad 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControlNS.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControlNS.java @@ -69,6 +69,7 @@ import org.osgi.framework.BundleContext; * consistent with the events. The purpose of this pattern is to allow clients * that listen to service events and track service state, to be perfectly in * sync with the service state. + * @since 1.1 */ public class MIRunControlNS extends AbstractDsfService implements IRunControl, ICachingService { @@ -667,17 +668,29 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I // Event handlers /////////////////////////////////////////////////////////////////////////// + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final MIRunningEvent e) { getSession().dispatchEvent(new ResumedEvent(e.getDMContext(), e), getProperties()); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final MIStoppedEvent e) { getSession().dispatchEvent(new SuspendedEvent(e.getDMContext(), e), getProperties()); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final MIThreadCreatedEvent e) { IContainerDMContext containerDmc = e.getDMContext(); @@ -688,6 +701,10 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I getSession().dispatchEvent(new StartedDMEvent(executionCtx, e), getProperties()); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(final MIThreadExitEvent e) { IContainerDMContext containerDmc = e.getDMContext(); @@ -698,6 +715,10 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I getSession().dispatchEvent(new ExitedDMEvent(executionCtx, e), getProperties()); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ResumedEvent e) { IExecutionDMContext ctx = e.getDMContext(); @@ -706,6 +727,10 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I } } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(SuspendedEvent e) { IExecutionDMContext ctx = e.getDMContext(); @@ -714,6 +739,10 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I } } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(StartedDMEvent e) { IExecutionDMContext executionCtx = e.getDMContext(); @@ -724,11 +753,19 @@ public class MIRunControlNS extends AbstractDsfService implements IRunControl, I } } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ExitedDMEvent e) { fThreadRunStates.remove(e.getDMContext()); } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(ICommandControlShutdownDMEvent e) { fTerminated = true; diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java index f05b46d755c..eb42e6d1bed 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java @@ -641,7 +641,10 @@ public class MIStack extends AbstractDsfService } } - // IServiceEventListener + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ @DsfServiceEventHandler public void eventDispatched(IResumedDMEvent e) { fMICommandCache.setContextAvailable(e.getDMContext(), false); @@ -651,12 +654,23 @@ public class MIStack extends AbstractDsfService } } + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + * @since 1.1 + */ @DsfServiceEventHandler public void eventDispatched(ISuspendedDMEvent e) { fMICommandCache.setContextAvailable(e.getDMContext(), true); fMICommandCache.reset(); } + + /** + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + * @since 1.1 + */ @DsfServiceEventHandler public void eventDispatched(IMIDMEvent e) { if (e.getMIEvent() instanceof MIStoppedEvent) { @@ -664,6 +678,19 @@ public class MIStack extends AbstractDsfService } } + /** + * This method is left for API compatibility only. + * @nooverride This method is not intended to be re-implemented or extended by clients. + * @noreference This method is not intended to be referenced by clients. + */ + @DsfServiceEventHandler + public void eventDispatched(MIRunControl.ContainerSuspendedEvent e) { + } + + /** + * {@inheritDoc} + * @since 1.1 + */ public void flushCache(IDMContext context) { fMICommandCache.reset(context); } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIVariableManager.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIVariableManager.java index 54f084ae263..672a8cff8c9 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIVariableManager.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIVariableManager.java @@ -1678,6 +1678,9 @@ public class MIVariableManager implements ICommandControl { } } + /** + * @since 1.1 + */ public void markAllOutOfDate() { MIRootVariableObject root; while ((root = updatedRootList.poll()) != null) { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractCLIProcess.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractCLIProcess.java index 7f3381c9b11..335bb4c8de0 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractCLIProcess.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractCLIProcess.java @@ -86,6 +86,9 @@ public abstract class AbstractCLIProcess extends Process private int fPrompt = 1; // 1 --> Primary prompt "(gdb)"; 2 --> Secondary Prompt ">" + /** + * @since 1.1 + */ @ConfinedToDsfExecutor("fSession#getExecutor") public AbstractCLIProcess(ICommandControlService commandControl) throws IOException { fSession = commandControl.getSession(); @@ -118,12 +121,19 @@ public abstract class AbstractCLIProcess extends Process fMIOutLogPipe = miOutLogPipe; fMIInLogPipe = miInLogPipe; } + + public AbstractCLIProcess(AbstractMIControl commandControl) throws IOException { + this ( (ICommandControlService)commandControl ); + } protected DsfSession getSession() { return fSession; } @Deprecated protected AbstractMIControl getCommandControl() { return (AbstractMIControl)fCommandControl; } + /** + * @since 1.1 + */ protected ICommandControlService getCommandControlService() { return fCommandControl; } protected boolean isDisposed() { return fDisposed; } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java index ea42be3e994..b20caf9fc93 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java @@ -118,6 +118,9 @@ public abstract class AbstractMIControl extends AbstractDsfService fUseThreadAndFrameOptions = false; } + /** + * @since 1.1 + */ public AbstractMIControl(DsfSession session, String id, boolean useThreadAndFrameOptions) { super(session); fId = id; @@ -359,10 +362,16 @@ public abstract class AbstractMIControl extends AbstractDsfService abstract public MIControlDMContext getControlDMContext(); + /** + * @since 1.1 + */ public boolean isActive() { return !fStoppedCommandProcessing; } + /** + * @since 1.1 + */ public String getId() { return fId; } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/CLIEventProcessor.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/CLIEventProcessor.java index 6af69acd118..33ada21a211 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/CLIEventProcessor.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/CLIEventProcessor.java @@ -60,6 +60,9 @@ public class CLIEventProcessor private final DsfServicesTracker fServicesTracker; + /** + * @since 1.1 + */ public CLIEventProcessor(ICommandControlService connection, ICommandControlDMContext controlDmc) { fCommandControl = connection; fControlDmc = controlDmc; @@ -71,7 +74,7 @@ public class CLIEventProcessor } @Deprecated - public CLIEventProcessor(ICommandControlService connection, IContainerDMContext containerDmc, MIInferiorProcess inferior) { + public CLIEventProcessor(AbstractMIControl connection, IContainerDMContext containerDmc, MIInferiorProcess inferior) { this(connection, DMContexts.getAncestorOfType(containerDmc, ICommandControlDMContext.class)); } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/CLIEventProcessor_7_0.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/CLIEventProcessor_7_0.java index 7192698b35f..e688c8bd3a4 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/CLIEventProcessor_7_0.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/CLIEventProcessor_7_0.java @@ -37,6 +37,7 @@ import org.eclipse.dd.mi.service.command.events.MISignalChangedEvent; /** * GDB debugger output listener. + * @since 1.1 */ @ConfinedToDsfExecutor("fConnection#getExecutor") public class CLIEventProcessor_7_0 diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIControlDMContext.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIControlDMContext.java index 83099fcc7ff..64d94984165 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIControlDMContext.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIControlDMContext.java @@ -50,6 +50,9 @@ public class MIControlDMContext extends AbstractDMContext return fCommandControlFilter; } + /** + * @since 1.1 + */ public String getCommandControlId() { return fCommandControlId; } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIInferiorProcess.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIInferiorProcess.java index 176ba90b350..8e1c307ddb1 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIInferiorProcess.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIInferiorProcess.java @@ -140,19 +140,25 @@ public class MIInferiorProcess extends Process * @param inferiorExecCtx The execution context controlling the execution * state of the inferior process. * @param gdbOutputStream The output stream to use to write user IO into. + * @since 1.1 */ @ConfinedToDsfExecutor("fSession#getExecutor") public MIInferiorProcess(ICommandControlService commandControl, IExecutionDMContext inferiorExecCtx, OutputStream gdbOutputStream) { this(commandControl, inferiorExecCtx, gdbOutputStream, null); } + public MIInferiorProcess(AbstractMIControl commandControl, IExecutionDMContext inferiorExecCtx, OutputStream gdbOutputStream) { + this(commandControl, inferiorExecCtx, gdbOutputStream, null); + } + /** * @deprecated {@link #MIInferiorProcess(ICommandControlService, IExecutionDMContext, OutputStream)} * should be used instead. + * @since 1.1 */ @ConfinedToDsfExecutor("fSession#getExecutor") @Deprecated - public MIInferiorProcess(ICommandControlService commandControl, OutputStream gdbOutputStream) { + public MIInferiorProcess(AbstractMIControl commandControl, OutputStream gdbOutputStream) { this(commandControl, null, gdbOutputStream, null); } @@ -164,19 +170,25 @@ public class MIInferiorProcess extends Process * @param inferiorExecCtx The execution context controlling the execution * state of the inferior process. * @param p The terminal to use to write user IO into. + * @since 1.1 */ @ConfinedToDsfExecutor("fSession#getExecutor") public MIInferiorProcess(ICommandControlService commandControl, IExecutionDMContext inferiorExecCtx, PTY p) { this(commandControl, inferiorExecCtx, null, p); } + public MIInferiorProcess(AbstractMIControl commandControl, IExecutionDMContext inferiorExecCtx, PTY p) { + this(commandControl, inferiorExecCtx, null, p); + } + /** * @deprecated Should use {@link #MIInferiorProcess(ICommandControlService, IExecutionDMContext, PTY)} * instead. + * @since 1.1 */ @ConfinedToDsfExecutor("fSession#getExecutor") @Deprecated - public MIInferiorProcess(ICommandControlService commandControl, PTY p) { + public MIInferiorProcess(AbstractMIControl commandControl, PTY p) { this(commandControl, null, null, p); } @@ -245,9 +257,15 @@ public class MIInferiorProcess extends Process return fSession; } + /** + * @since 1.1 + */ @Deprecated protected AbstractMIControl getCommandControl() { return (AbstractMIControl)fCommandControl; } + /** + * @since 1.1 + */ protected ICommandControlService getCommandControlService() { return fCommandControl; } protected boolean isDisposed() { return fDisposed; } @@ -419,18 +437,30 @@ public class MIInferiorProcess extends Process return fInputStreamPiped; } + /** + * @since 1.1 + */ public OutputStream getPipedErrorStream() { return fErrorStreamPiped; } + /** + * @since 1.1 + */ public PTY getPTY() { return fPty; } + /** + * @since 1.1 + */ public String getPid() { return fInferiorPid; } + /** + * @since 1.1 + */ public void setPid(String pid) { fInferiorPid = pid; } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIRunControlEventProcessor_7_0.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIRunControlEventProcessor_7_0.java index b0810ce8b63..b2f70c5d614 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIRunControlEventProcessor_7_0.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/MIRunControlEventProcessor_7_0.java @@ -67,6 +67,7 @@ import org.eclipse.dd.mi.service.command.output.MIValue; * MI debugger output listener that listens for the parsed MI output, and * generates corresponding MI events. The generated MI events are then * received by other services and clients. + * @since 1.1 */ public class MIRunControlEventProcessor_7_0 implements IEventListener, ICommandListener diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIAttach.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIAttach.java index 6b4de5ba5ab..599d46e9d04 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIAttach.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIAttach.java @@ -23,6 +23,9 @@ public class CLIAttach extends CLICommand { super(ctx, "attach " + Integer.toString(pid)); //$NON-NLS-1$ } + /** + * @since 1.1 + */ public CLIAttach(ICommandControlDMContext ctx, String pid) { super(ctx, "attach " + pid); //$NON-NLS-1$ } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIDetach.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIDetach.java index 1582f0ed61e..099e2613854 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIDetach.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIDetach.java @@ -15,6 +15,7 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; /** * This command disconnects from a remote target. + * @since 1.1 */ public class CLIDetach extends CLICommand { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIExecAbort.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIExecAbort.java index 7230f0cf7c8..e580f4f9d5f 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIExecAbort.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLIExecAbort.java @@ -13,6 +13,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; /** @@ -24,7 +25,14 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; */ public class CLIExecAbort extends CLICommand { + /** + * @since 1.1 + */ public CLIExecAbort(ICommandControlDMContext ctx) { super(ctx, "kill"); //$NON-NLS-1$ } + + public CLIExecAbort(MIControlDMContext ctx) { + this ((ICommandControlDMContext)ctx); + } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLISource.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLISource.java index 55f5b01bc41..45ebb8a40a5 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLISource.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/CLISource.java @@ -11,6 +11,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; /** @@ -21,7 +22,14 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; * */ public class CLISource extends CLICommand { + /** + * @since 1.1 + */ public CLISource(ICommandControlDMContext ctx, String file) { super(ctx, "source " + file); //$NON-NLS-1$ } + + public CLISource(MIControlDMContext ctx, String file) { + this ((ICommandControlDMContext)ctx, file); + } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MICommand.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MICommand.java index 39b1a4e5d17..4c7146fe7f1 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MICommand.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MICommand.java @@ -137,6 +137,9 @@ public class MICommand implements ICommand { /* * Returns the constructed command potentially using the --thread/--frame options. */ + /** + * @since 1.1 + */ public String constructCommand(String threadId, int frameId) { StringBuffer command = new StringBuffer(getOperation()); @@ -234,6 +237,9 @@ public class MICommand implements ICommand { return false; } + /** + * @since 1.1 + */ public boolean supportsThreadAndFrameOptions() { return true; } /** diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIDataEvaluateExpression.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIDataEvaluateExpression.java index f12e6bd8f91..e57e9e34bd8 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIDataEvaluateExpression.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIDataEvaluateExpression.java @@ -16,6 +16,7 @@ import org.eclipse.dd.dsf.debug.service.IExpressions.IExpressionDMContext; import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; import org.eclipse.dd.mi.service.IMIExecutionDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIDataEvaluateExpressionInfo; import org.eclipse.dd.mi.service.command.output.MIOutput; @@ -30,9 +31,17 @@ import org.eclipse.dd.mi.service.command.output.MIOutput; */ public class MIDataEvaluateExpression extends MICommand { + /** + * @since 1.1 + */ public MIDataEvaluateExpression(ICommandControlDMContext ctx, String expr) { super(ctx, "-data-evaluate-expression", new String[]{expr}); //$NON-NLS-1$ } + + public MIDataEvaluateExpression(MIControlDMContext ctx, String expr) { + this ((ICommandControlDMContext)ctx, expr); + } + public MIDataEvaluateExpression(IMIExecutionDMContext execDmc, String expr) { super(execDmc, "-data-evaluate-expression", new String[]{expr}); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIEnvironmentCD.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIEnvironmentCD.java index a0b8ec94507..b31b815041c 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIEnvironmentCD.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIEnvironmentCD.java @@ -18,6 +18,7 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; * -environment-cd PATHDIR * * Set GDB's working directory. + * @since 1.1 * */ public class MIEnvironmentCD extends MICommand diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecContinue.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecContinue.java index 180dc319d1f..148c5ae4b38 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecContinue.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecContinue.java @@ -29,6 +29,9 @@ public class MIExecContinue extends MICommand this(dmc, false); } + /** + * @since 1.1 + */ public MIExecContinue(IExecutionDMContext dmc, boolean allThreads) { super(dmc, "-exec-continue"); //$NON-NLS-1$ if (allThreads) { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecInterrupt.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecInterrupt.java index a031fc02207..b35e8f1d748 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecInterrupt.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIExecInterrupt.java @@ -34,6 +34,9 @@ public class MIExecInterrupt extends MICommand this(dmc, false); } + /** + * @since 1.1 + */ public MIExecInterrupt(IExecutionDMContext dmc, boolean allThreads) { super(dmc, "-exec-interrupt"); //$NON-NLS-1$ if (allThreads) { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecAndSymbols.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecAndSymbols.java index 45d2ce913f9..0f911a3bfd0 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecAndSymbols.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecAndSymbols.java @@ -12,6 +12,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; @@ -25,11 +26,25 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; */ public class MIFileExecAndSymbols extends MICommand { + /** + * @since 1.1 + */ public MIFileExecAndSymbols(ICommandControlDMContext dmc, String file) { super(dmc, "-file-exec-and-symbols", null, new String[] {file}); //$NON-NLS-1$ } + + public MIFileExecAndSymbols(MIControlDMContext dmc, String file) { + this ((ICommandControlDMContext)dmc, file); + } + /** + * @since 1.1 + */ public MIFileExecAndSymbols(ICommandControlDMContext dmc) { super(dmc, "-file-exec-and-symbols"); //$NON-NLS-1$ } + + public MIFileExecAndSymbols(MIControlDMContext dmc) { + this ((ICommandControlDMContext)dmc); + } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecFile.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecFile.java index 0c1c2be9141..27ca9758da2 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecFile.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileExecFile.java @@ -13,6 +13,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; @@ -26,11 +27,25 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; */ public class MIFileExecFile extends MICommand { + /** + * @since 1.1 + */ public MIFileExecFile(ICommandControlDMContext dmc, String file) { super(dmc, "-file-exec-file", null, new String[] {file}); //$NON-NLS-1$ } + + public MIFileExecFile(MIControlDMContext dmc, String file) { + this ((ICommandControlDMContext)dmc, file); + } + /** + * @since 1.1 + */ public MIFileExecFile(ICommandControlDMContext dmc) { super(dmc, "-file-exec-file"); //$NON-NLS-1$ } + + public MIFileExecFile(MIControlDMContext dmc) { + this ((ICommandControlDMContext)dmc); + } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileSymbolFile.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileSymbolFile.java index 92c675f6d1a..96ae62c66ea 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileSymbolFile.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIFileSymbolFile.java @@ -13,6 +13,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; @@ -25,11 +26,25 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; */ public class MIFileSymbolFile extends MICommand { + /** + * @since 1.1 + */ public MIFileSymbolFile(ICommandControlDMContext dmc, String file) { super(dmc, "-file-symbol-file", null, new String[] {file}); //$NON-NLS-1$ } + + public MIFileSymbolFile(MIControlDMContext dmc, String file) { + this ((ICommandControlDMContext)dmc, file); + } + /** + * @since 1.1 + */ public MIFileSymbolFile(ICommandControlDMContext dmc) { super(dmc, "-file-symbol-file"); //$NON-NLS-1$ } + + public MIFileSymbolFile(MIControlDMContext dmc) { + this ((ICommandControlDMContext)dmc); + } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetArgs.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetArgs.java index 095c6f46a81..14e47246365 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetArgs.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetArgs.java @@ -18,6 +18,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC * -gdb-set args ARGS * * Set the inferior program arguments, to be used in the next `-exec-run'. + * @since 1.1 * */ public class MIGDBSetArgs extends MIGDBSet diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetAutoSolib.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetAutoSolib.java index 0501534c747..fb2b9d8fd63 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetAutoSolib.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetAutoSolib.java @@ -11,6 +11,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; /** * @@ -19,7 +20,14 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC */ public class MIGDBSetAutoSolib extends MIGDBSet { + /** + * @since 1.1 + */ public MIGDBSetAutoSolib(ICommandControlDMContext ctx, boolean isSet) { super(ctx, new String[] {"auto-solib-add", isSet ? "on" : "off"});//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ } + + public MIGDBSetAutoSolib(MIControlDMContext ctx, boolean isSet) { + this ((ICommandControlDMContext)ctx, isSet); + } } \ No newline at end of file diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetBreakpointApply.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetBreakpointApply.java index 108b1a11fdc..1b21b083340 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetBreakpointApply.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetBreakpointApply.java @@ -19,6 +19,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC * Set breakpoints applicability mode. * global == a breakpoint applies to all processes. * process == a breakpoint applies to a single process. + * @since 1.1 */ public class MIGDBSetBreakpointApply extends MIGDBSet { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetNonStop.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetNonStop.java index a08ba9619e1..f43a391af36 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetNonStop.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetNonStop.java @@ -15,6 +15,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC /** * * -gdb-set non-stop [on | off] + * @since 1.1 * */ public class MIGDBSetNonStop extends MIGDBSet diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetSolibSearchPath.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetSolibSearchPath.java index 97170a27a17..89c906c17d5 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetSolibSearchPath.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetSolibSearchPath.java @@ -11,6 +11,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; /** * @@ -19,6 +20,9 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC */ public class MIGDBSetSolibSearchPath extends MIGDBSet { + /** + * @since 1.1 + */ public MIGDBSetSolibSearchPath(ICommandControlDMContext ctx, String[] paths) { super(ctx, null); // Overload the parameter @@ -34,4 +38,8 @@ public class MIGDBSetSolibSearchPath extends MIGDBSet String[] p = new String [] {"solib-search-path", buffer.toString()}; //$NON-NLS-1$ setParameters(p); } + + public MIGDBSetSolibSearchPath(MIControlDMContext ctx, String[] paths) { + this ((ICommandControlDMContext)ctx, paths); + } } \ No newline at end of file diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetSysroot.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetSysroot.java index cfdf75b458a..57596d3ab7b 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetSysroot.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBSetSysroot.java @@ -15,6 +15,7 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC /** * * -gdb-set sysroot PATH + * @since 1.1 * */ public class MIGDBSetSysroot extends MIGDBSet diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBShowExitCode.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBShowExitCode.java index 5a8abf29996..68045c12ab8 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBShowExitCode.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIGDBShowExitCode.java @@ -13,6 +13,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIGDBShowExitCodeInfo; import org.eclipse.dd.mi.service.command.output.MIOutput; @@ -26,9 +27,16 @@ import org.eclipse.dd.mi.service.command.output.MIOutput; */ public class MIGDBShowExitCode extends MIDataEvaluateExpression { + /** + * @since 1.1 + */ public MIGDBShowExitCode(ICommandControlDMContext ctx) { super(ctx, "$_exitcode"); //$NON-NLS-1$ } + + public MIGDBShowExitCode(MIControlDMContext ctx) { + this ((ICommandControlDMContext)ctx); + } @Override public MIGDBShowExitCodeInfo getResult(MIOutput output) { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIInferiorTTYSet.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIInferiorTTYSet.java index 726f7feed2d..b7b042da498 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIInferiorTTYSet.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIInferiorTTYSet.java @@ -12,6 +12,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIInfo; @@ -22,7 +23,14 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; */ public class MIInferiorTTYSet extends MICommand { + /** + * @since 1.1 + */ public MIInferiorTTYSet(ICommandControlDMContext dmc, String tty) { super(dmc, "-inferior-tty-set", null, new String[] {tty}); //$NON-NLS-1$ } + + public MIInferiorTTYSet(MIControlDMContext dmc, String tty) { + this ((ICommandControlDMContext)dmc, tty); + } } \ No newline at end of file diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIListThreadGroups.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIListThreadGroups.java index 570b8fea7b6..d7b890d2e23 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIListThreadGroups.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIListThreadGroups.java @@ -40,6 +40,7 @@ import org.eclipse.dd.mi.service.command.output.MIOutput; * {id="xxx",type="process",pid="yyy",num_children="1"} * * The id of a thread group should be considered an opaque string. + * @since 1.1 * */ public class MIListThreadGroups extends MICommand { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetAttach.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetAttach.java index 3d48fae25a7..73c4fa34242 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetAttach.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetAttach.java @@ -18,6 +18,7 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; * * This command attaches to the process specified by the PID * or THREAD_GROUP_ID + * @since 1.1 */ public class MITargetAttach extends MICommand { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetDetach.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetDetach.java index 123a8350ab2..42e7612a610 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetDetach.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MITargetDetach.java @@ -18,6 +18,7 @@ import org.eclipse.dd.mi.service.command.output.MIInfo; * * This command detaches from the process specified by the PID * or THREAD_GROUP_ID + * @since 1.1 */ public class MITargetDetach extends MICommand { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadInfo.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadInfo.java index 1f275c5a0ba..958c1dc6fc7 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadInfo.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadInfo.java @@ -22,6 +22,7 @@ import org.eclipse.dd.mi.service.command.output.MIThreadInfoInfo; * Reports information about either a specific thread, if [thread-id] is present, * or about all threads. When printing information about all threads, also reports * the current thread. + * @since 1.1 * */ public class MIThreadInfo extends MICommand { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadSelect.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadSelect.java index 0f1fce70f2b..3bbcf6a185e 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadSelect.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIThreadSelect.java @@ -31,6 +31,9 @@ public class MIThreadSelect extends MICommand super(ctx, "-thread-select", new String[]{Integer.toString(threadNum)}); //$NON-NLS-1$ } + /** + * @since 1.1 + */ public MIThreadSelect(IDMContext ctx, String threadNum) { super(ctx, "-thread-select", new String[]{threadNum}); //$NON-NLS-1$ } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarAssign.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarAssign.java index 490ffa1520b..3db893f8cde 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarAssign.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarAssign.java @@ -12,6 +12,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarAssignInfo; @@ -25,10 +26,16 @@ import org.eclipse.dd.mi.service.command.output.MIVarAssignInfo; */ public class MIVarAssign extends MICommand { + /** + * @since 1.1 + */ public MIVarAssign(ICommandControlDMContext ctx, String name, String expression) { super(ctx, "-var-assign", new String[]{name, expression}); //$NON-NLS-1$ } - + + public MIVarAssign(MIControlDMContext ctx, String name, String expression) { + this ((ICommandControlDMContext)ctx, name, expression); + } @Override public MIVarAssignInfo getResult(MIOutput out) { return new MIVarAssignInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarDelete.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarDelete.java index 5027acd4051..6a652a6898d 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarDelete.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarDelete.java @@ -13,6 +13,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarDeleteInfo; @@ -27,10 +28,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarDeleteInfo; */ public class MIVarDelete extends MICommand { + /** + * @since 1.1 + */ public MIVarDelete(ICommandControlDMContext dmc, String name) { super(dmc, "-var-delete", new String[]{name}); //$NON-NLS-1$ } + public MIVarDelete(MIControlDMContext dmc, String name) { + this ((ICommandControlDMContext)dmc, name); + } + @Override public MIVarDeleteInfo getResult(MIOutput out) { return new MIVarDeleteInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarEvaluateExpression.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarEvaluateExpression.java index 1065f11866d..1beff4eaa89 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarEvaluateExpression.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarEvaluateExpression.java @@ -14,6 +14,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarEvaluateExpressionInfo; @@ -30,10 +31,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarEvaluateExpressionInfo; */ public class MIVarEvaluateExpression extends MICommand { + /** + * @since 1.1 + */ public MIVarEvaluateExpression(ICommandControlDMContext dmc, String name) { super(dmc, "-var-evaluate-expression", new String[] { name }); //$NON-NLS-1$ } + public MIVarEvaluateExpression(MIControlDMContext dmc, String name) { + this ((ICommandControlDMContext)dmc, name); + } + @Override public MIVarEvaluateExpressionInfo getResult(MIOutput out) { return new MIVarEvaluateExpressionInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoExpression.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoExpression.java index 30a71477c66..5caf1e2a743 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoExpression.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoExpression.java @@ -12,6 +12,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarInfoExpressionInfo; @@ -30,10 +31,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarInfoExpressionInfo; //MIVarInfoExpression.java public class MIVarInfoExpression extends MICommand { + /** + * @since 1.1 + */ public MIVarInfoExpression(ICommandControlDMContext ctx, String name) { super(ctx, "-var-info-expression", new String[]{name}); //$NON-NLS-1$ } - + + public MIVarInfoExpression(MIControlDMContext ctx, String name) { + this ((ICommandControlDMContext)ctx, name); + } + @Override public MIVarInfoExpressionInfo getResult(MIOutput out) { return new MIVarInfoExpressionInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoPathExpression.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoPathExpression.java index 7c69890be53..95da33bd634 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoPathExpression.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoPathExpression.java @@ -12,6 +12,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarInfoPathExpressionInfo; @@ -30,10 +31,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarInfoPathExpressionInfo; public class MIVarInfoPathExpression extends MICommand { + /** + * @since 1.1 + */ public MIVarInfoPathExpression(ICommandControlDMContext dmc, String name) { super(dmc, "-var-info-path-expression", new String[]{name}); //$NON-NLS-1$ } - + + public MIVarInfoPathExpression(MIControlDMContext dmc, String name) { + this ((ICommandControlDMContext)dmc, name); + } + @Override public MIVarInfoPathExpressionInfo getResult(MIOutput out) { return new MIVarInfoPathExpressionInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoType.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoType.java index 40fce7f2e68..a919e4da5ac 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoType.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarInfoType.java @@ -12,6 +12,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarInfoTypeInfo; @@ -28,10 +29,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarInfoTypeInfo; */ public class MIVarInfoType extends MICommand { + /** + * @since 1.1 + */ public MIVarInfoType(ICommandControlDMContext ctx, String name) { super(ctx, "-var-info-type", new String[]{name}); //$NON-NLS-1$ } - + + public MIVarInfoType(MIControlDMContext ctx, String name) { + this ((ICommandControlDMContext)ctx, name); + } + @Override public MIVarInfoTypeInfo getResult(MIOutput out) { return new MIVarInfoTypeInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarListChildren.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarListChildren.java index cb063fe7bc5..4449553d1d1 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarListChildren.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarListChildren.java @@ -14,6 +14,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarListChildrenInfo; @@ -29,10 +30,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarListChildrenInfo; */ public class MIVarListChildren extends MICommand { + /** + * @since 1.1 + */ public MIVarListChildren(ICommandControlDMContext ctx, String name) { super(ctx, "-var-list-children", new String[]{name}); //$NON-NLS-1$ } + public MIVarListChildren(MIControlDMContext ctx, String name) { + this ((ICommandControlDMContext)ctx, name); + } + @Override public MIVarListChildrenInfo getResult(MIOutput out) { return new MIVarListChildrenInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarSetFormat.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarSetFormat.java index c8e5bd0f51d..65133a8b663 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarSetFormat.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarSetFormat.java @@ -15,6 +15,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.IFormattedValues; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarSetFormatInfo; @@ -33,10 +34,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarSetFormatInfo; */ public class MIVarSetFormat extends MICommand { + /** + * @since 1.1 + */ public MIVarSetFormat(ICommandControlDMContext ctx, String name, String fmt) { super(ctx, "-var-set-format"); //$NON-NLS-1$ setParameters(new String[]{name, getFormat(fmt)}); } + + public MIVarSetFormat(MIControlDMContext ctx, String name, String fmt) { + this ((ICommandControlDMContext)ctx, name, fmt); + } private String getFormat(String fmt){ String format = "natural"; //$NON-NLS-1$ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarShowAttributes.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarShowAttributes.java index 1b5bb330970..a3772e08a17 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarShowAttributes.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarShowAttributes.java @@ -12,6 +12,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarShowAttributesInfo; @@ -30,10 +31,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarShowAttributesInfo; public class MIVarShowAttributes extends MICommand { + /** + * @since 1.1 + */ public MIVarShowAttributes(ICommandControlDMContext ctx, String name) { super(ctx, "-var-show-attributes", new String[]{name}); //$NON-NLS-1$ } - + + public MIVarShowAttributes(MIControlDMContext ctx, String name) { + this ((ICommandControlDMContext)ctx, name); + } + @Override public MIVarShowAttributesInfo getResult(MIOutput out) { return new MIVarShowAttributesInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarShowFormat.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarShowFormat.java index f7f81e14de3..066036d444f 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarShowFormat.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarShowFormat.java @@ -12,6 +12,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarShowFormatInfo; @@ -27,10 +28,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarShowFormatInfo; */ public class MIVarShowFormat extends MICommand { + /** + * @since 1.1 + */ public MIVarShowFormat(ICommandControlDMContext ctx, String name) { super(ctx, "-var-show-format", new String[]{name}); //$NON-NLS-1$ } + public MIVarShowFormat(MIControlDMContext ctx, String name) { + this ((ICommandControlDMContext)ctx, name); + } + @Override public MIVarShowFormatInfo getResult(MIOutput out) { return new MIVarShowFormatInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarUpdate.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarUpdate.java index c49861c3968..3d1f3cf78a5 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarUpdate.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/commands/MIVarUpdate.java @@ -14,6 +14,7 @@ package org.eclipse.dd.mi.service.command.commands; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIOutput; import org.eclipse.dd.mi.service.command.output.MIVarUpdateInfo; @@ -31,10 +32,17 @@ import org.eclipse.dd.mi.service.command.output.MIVarUpdateInfo; */ public class MIVarUpdate extends MICommand { + /** + * @since 1.1 + */ public MIVarUpdate(ICommandControlDMContext dmc, String name) { super(dmc, "-var-update", new String[] { "1", name }); //$NON-NLS-1$//$NON-NLS-2$ } + public MIVarUpdate(MIControlDMContext ctx, String name) { + this ((ICommandControlDMContext)ctx, name); + } + @Override public MIVarUpdateInfo getResult(MIOutput out) { return new MIVarUpdateInfo(out); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIBreakpointHitEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIBreakpointHitEvent.java index c274a66f077..1598cff9bee 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIBreakpointHitEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIBreakpointHitEvent.java @@ -64,6 +64,9 @@ public class MIBreakpointHitEvent extends MIStoppedEvent { return new MIBreakpointHitEvent(stoppedEvent.getDMContext(), token, results, stoppedEvent.getFrame(), bkptno); } + /** + * @since 1.1 + */ public static MIBreakpointHitEvent parse(IExecutionDMContext dmc, int token, MIResult[] results) { int bkptno = -1; diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIDetachedEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIDetachedEvent.java index 3e3acf37ad8..14cae398ac3 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIDetachedEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIDetachedEvent.java @@ -14,6 +14,7 @@ package org.eclipse.dd.mi.service.command.events; import org.eclipse.dd.dsf.concurrent.Immutable; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; /** @@ -23,10 +24,17 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC @Immutable public class MIDetachedEvent extends MIEvent { + /** + * @since 1.1 + */ public MIDetachedEvent(ICommandControlDMContext ctx, int token) { super(ctx, token, null); } + public MIDetachedEvent(MIControlDMContext ctx, int token) { + this ((ICommandControlDMContext)ctx, token); + } + @Override public String toString() { return "Detached"; //$NON-NLS-1$ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIFunctionFinishedEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIFunctionFinishedEvent.java index 8eff9ef4511..02647c1c2d0 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIFunctionFinishedEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIFunctionFinishedEvent.java @@ -82,6 +82,9 @@ public class MIFunctionFinishedEvent extends MIStoppedEvent { return new MIFunctionFinishedEvent(stoppedEvent.getDMContext(), token, results, stoppedEvent.getFrame(), gdbResult, returnValue, returnType); } + /** + * @since 1.1 + */ public static MIFunctionFinishedEvent parse(IExecutionDMContext dmc, int token, MIResult[] results) { String gdbResult = ""; //$NON-NLS-1$ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIGDBExitEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIGDBExitEvent.java index 776c0ba7611..8f782bcc356 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIGDBExitEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIGDBExitEvent.java @@ -15,6 +15,7 @@ package org.eclipse.dd.mi.service.command.events; import org.eclipse.dd.dsf.concurrent.Immutable; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; /** @@ -23,10 +24,18 @@ import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandC * @deprecated This event is not used in DSF-GDB as it has been replaced by * {@link ICommandControlService.ICommandControlShutdownDMEvent}. */ +@Deprecated @Immutable public class MIGDBExitEvent extends MIEvent { + /** + * @since 1.1 + */ public MIGDBExitEvent(ICommandControlDMContext ctx, int token) { super(ctx, token, null); } + + public MIGDBExitEvent(MIControlDMContext ctx, int token) { + this ((ICommandControlDMContext)ctx, token); + } } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIInferiorExitEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIInferiorExitEvent.java index 6c70e859f2a..71f98853c6e 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIInferiorExitEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIInferiorExitEvent.java @@ -14,6 +14,7 @@ package org.eclipse.dd.mi.service.command.events; import org.eclipse.dd.dsf.concurrent.Immutable; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIConst; import org.eclipse.dd.mi.service.command.output.MIResult; import org.eclipse.dd.mi.service.command.output.MIValue; @@ -29,15 +30,29 @@ public class MIInferiorExitEvent extends MIEvent { final private int code; + /** + * @since 1.1 + */ public MIInferiorExitEvent(ICommandControlDMContext ctx, int token, MIResult[] results, int code) { super(ctx, token, results); this.code = code; } + public MIInferiorExitEvent(MIControlDMContext ctx, int token, MIResult[] results, int code) { + this ((ICommandControlDMContext)ctx, token, results, code); + } + public int getExitCode() { return code; } + public static MIInferiorExitEvent parse(MIControlDMContext ctx, int token, MIResult[] results) { + return parse((ICommandControlDMContext)ctx, token, results); + } + + /** + * @since 1.1 + */ public static MIInferiorExitEvent parse(ICommandControlDMContext ctx, int token, MIResult[] results) { int code = 0; diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIInferiorSignalExitEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIInferiorSignalExitEvent.java index 08b5ae5cc2c..9e4fce2f184 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIInferiorSignalExitEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIInferiorSignalExitEvent.java @@ -14,6 +14,7 @@ package org.eclipse.dd.mi.service.command.events; import org.eclipse.dd.dsf.concurrent.Immutable; import org.eclipse.dd.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; +import org.eclipse.dd.mi.service.command.MIControlDMContext; import org.eclipse.dd.mi.service.command.output.MIConst; import org.eclipse.dd.mi.service.command.output.MIResult; import org.eclipse.dd.mi.service.command.output.MIValue; @@ -30,12 +31,19 @@ public class MIInferiorSignalExitEvent extends MIEvent final private String sigName; final private String sigMeaning; + /** + * @since 1.1 + */ public MIInferiorSignalExitEvent(ICommandControlDMContext ctx, int token, MIResult[] results, String sigName, String sigMeaning) { super(ctx, token, results); this.sigName = sigName; this.sigMeaning = sigMeaning; } + public MIInferiorSignalExitEvent(MIControlDMContext ctx, int token, MIResult[] results, String sigName, String sigMeaning) { + this((ICommandControlDMContext)ctx, token, results, sigName, sigMeaning); + } + public String getName() { return sigName; } @@ -44,6 +52,13 @@ public class MIInferiorSignalExitEvent extends MIEvent return sigMeaning; } + public static MIInferiorSignalExitEvent parse(MIControlDMContext ctx, int token, MIResult[] results) { + return parse((ICommandControlDMContext)ctx, token, results); + } + + /** + * @since 1.1 + */ public static MIInferiorSignalExitEvent parse(ICommandControlDMContext ctx, int token, MIResult[] results) { String sigName = ""; //$NON-NLS-1$ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MILocationReachedEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MILocationReachedEvent.java index 3089f0ab365..42edbce27bc 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MILocationReachedEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MILocationReachedEvent.java @@ -37,6 +37,9 @@ public class MILocationReachedEvent extends MIStoppedEvent { return new MILocationReachedEvent(stoppedEvent.getDMContext(), token, results, stoppedEvent.getFrame()); } + /** + * @since 1.1 + */ public static MILocationReachedEvent parse(IExecutionDMContext dmc, int token, MIResult[] results) { MIStoppedEvent stoppedEvent = MIStoppedEvent.parse(dmc, token, results); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MISignalEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MISignalEvent.java index 14619016b20..5aef1ef1c1e 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MISignalEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MISignalEvent.java @@ -75,6 +75,9 @@ public class MISignalEvent extends MIStoppedEvent { } + /** + * @since 1.1 + */ public static MISignalEvent parse(IExecutionDMContext dmc, int token, MIResult[] results) { String sigName = ""; //$NON-NLS-1$ diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MISteppingRangeEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MISteppingRangeEvent.java index 6e3fcd9c604..927bf379166 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MISteppingRangeEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MISteppingRangeEvent.java @@ -38,6 +38,9 @@ public class MISteppingRangeEvent extends MIStoppedEvent { return new MISteppingRangeEvent(stoppedEvent.getDMContext(), token, results, stoppedEvent.getFrame()); } + /** + * @since 1.1 + */ public static MISteppingRangeEvent parse(IExecutionDMContext dmc, int token, MIResult[] results) { MIStoppedEvent stoppedEvent = MIStoppedEvent.parse(dmc, token, results); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIStoppedEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIStoppedEvent.java index 0584ae5af7c..52dc222619e 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIStoppedEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIStoppedEvent.java @@ -72,6 +72,9 @@ public class MIStoppedEvent extends MIEvent { return new MIStoppedEvent(execDmc, token, results, frame); } + /** + * @since 1.1 + */ public static MIStoppedEvent parse(IExecutionDMContext dmc, int token, MIResult[] results) { MIFrame frame = null; diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadCreatedEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadCreatedEvent.java index bebd9071acd..7cd9811850d 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadCreatedEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadCreatedEvent.java @@ -34,10 +34,16 @@ public class MIThreadCreatedEvent extends MIEvent { fThreadId = Integer.toString(id); } + /** + * @since 1.1 + */ public MIThreadCreatedEvent(IContainerDMContext ctx, String threadId) { this(ctx, 0, threadId); } + /** + * @since 1.1 + */ public MIThreadCreatedEvent(IContainerDMContext ctx, int token, String threadId) { super(ctx, token, null); fThreadId = threadId; @@ -52,6 +58,9 @@ public class MIThreadCreatedEvent extends MIEvent { } } + /** + * @since 1.1 + */ public String getStrId() { return fThreadId; } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadExitEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadExitEvent.java index b93b321f4b5..128d68b081e 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadExitEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadExitEvent.java @@ -34,10 +34,16 @@ public class MIThreadExitEvent extends MIEvent { fThreadId = Integer.toString(id); } + /** + * @since 1.1 + */ public MIThreadExitEvent(IContainerDMContext ctx, String threadId) { this(ctx, 0, threadId); } + /** + * @since 1.1 + */ public MIThreadExitEvent(IContainerDMContext ctx, int token, String threadId) { super(ctx, token, null); fThreadId = threadId; @@ -52,6 +58,9 @@ public class MIThreadExitEvent extends MIEvent { } } + /** + * @since 1.1 + */ public String getStrId() { return fThreadId; } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadGroupCreatedEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadGroupCreatedEvent.java index 2f480a07935..c8f9a6ac205 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadGroupCreatedEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadGroupCreatedEvent.java @@ -17,6 +17,7 @@ import org.eclipse.dd.dsf.debug.service.IProcesses.IProcessDMContext; /** * This can only be detected by gdb/mi after GDB 6.8. + * @since 1.1 * */ @Immutable diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadGroupExitedEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadGroupExitedEvent.java index 80a00f55d56..c14010b8fb8 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadGroupExitedEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIThreadGroupExitedEvent.java @@ -17,6 +17,7 @@ import org.eclipse.dd.dsf.debug.service.IProcesses.IProcessDMContext; /** * This can only be detected by gdb/mi after GDB 6.8. + * @since 1.1 * */ @Immutable diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIWatchpointScopeEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIWatchpointScopeEvent.java index 662a2ed9f58..4779682b8f1 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIWatchpointScopeEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIWatchpointScopeEvent.java @@ -65,6 +65,9 @@ public class MIWatchpointScopeEvent extends MIStoppedEvent { return new MIWatchpointScopeEvent(stoppedEvent.getDMContext(), token, results, stoppedEvent.getFrame(), number); } + /** + * @since 1.1 + */ public static MIWatchpointScopeEvent parse(IExecutionDMContext dmc, int token, MIResult[] results) { int number = 0; diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIWatchpointTriggerEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIWatchpointTriggerEvent.java index 3383ece7a73..66a47ffe3f8 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIWatchpointTriggerEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/MIWatchpointTriggerEvent.java @@ -121,6 +121,9 @@ public class MIWatchpointTriggerEvent extends MIStoppedEvent { return new MIWatchpointTriggerEvent(stoppedEvent.getDMContext(), token, results, stoppedEvent.getFrame(), number, exp, oldValue, newValue); } + /** + * @since 1.1 + */ public static MIWatchpointTriggerEvent parse(IExecutionDMContext dmc, int token, MIResult[] results) { int number = 0; diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/IThreadFrame.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/IThreadFrame.java index da42815dbab..1bff9fc61ba 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/IThreadFrame.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/IThreadFrame.java @@ -12,6 +12,9 @@ package org.eclipse.dd.mi.service.command.output; import java.math.BigInteger; +/** + * @since 1.1 + */ public interface IThreadFrame { int getStackLevel(); BigInteger getAddress(); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/IThreadInfo.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/IThreadInfo.java index 7ac271b37c4..a4b7804ee8d 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/IThreadInfo.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/IThreadInfo.java @@ -11,6 +11,9 @@ package org.eclipse.dd.mi.service.command.output; +/** + * @since 1.1 + */ public interface IThreadInfo { String getThreadId(); String getTargetId(); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIListThreadGroupsInfo.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIListThreadGroupsInfo.java index 1cb81445d4f..dfacf65e4f9 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIListThreadGroupsInfo.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIListThreadGroupsInfo.java @@ -32,6 +32,7 @@ import org.eclipse.dd.dsf.concurrent.Immutable; * list-thread-groups GROUPID, in the case of a running thread or a stopped thread: * ^done,threads=[{id="1",target-id="Thread 162.32942",details="JUnitProcess_PT (Ready) 1030373359 44441",frame={level="0",addr="0x00000000",func="??",args=[]},state="stopped"}] * ^done,threads=[{id="1",target-id="Thread 162.32942",details="JUnitProcess_PT Idle 981333916 42692",state="running"}] + * @since 1.1 */ public class MIListThreadGroupsInfo extends MIInfo { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIThreadInfoInfo.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIThreadInfoInfo.java index 62772c7cf81..b846528b0f5 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIThreadInfoInfo.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIThreadInfoInfo.java @@ -70,6 +70,7 @@ import java.util.regex.Pattern; * file="/local/home/lmckhou/TSP/TADE/example/JUnitProcess_OU/src/ExpressionTestApp.cc", * fullname="/local/home/lmckhou/TSP/TADE/example/JUnitProcess_OU/src/ExpressionTestApp.cc",line="279"}, * state="stopped"}] + * @since 1.1 */ public class MIThreadInfoInfo extends MIInfo { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIThreadListIdsInfo.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIThreadListIdsInfo.java index c08399e0949..ea5c6d16dbb 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIThreadListIdsInfo.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/MIThreadListIdsInfo.java @@ -41,6 +41,9 @@ public class MIThreadListIdsInfo extends MIInfo { return threadIds; } + /** + * @since 1.1 + */ public String[] getStrThreadIds() { if (strThreadIds == null) { parse(); diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/ThreadFrame.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/ThreadFrame.java index 964b373fe9a..516e7b8a69b 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/ThreadFrame.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/ThreadFrame.java @@ -14,6 +14,9 @@ import java.math.BigInteger; import org.eclipse.dd.dsf.concurrent.Immutable; +/** + * @since 1.1 + */ @Immutable public class ThreadFrame implements IThreadFrame { final private int fStackLevel; diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/ThreadInfo.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/ThreadInfo.java index 1d0d3ce018e..5b671f9d06a 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/ThreadInfo.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/output/ThreadInfo.java @@ -12,6 +12,9 @@ package org.eclipse.dd.mi.service.command.output; import org.eclipse.dd.dsf.concurrent.Immutable; +/** + * @since 1.1 + */ @Immutable public class ThreadInfo implements IThreadInfo { @@ -41,8 +44,4 @@ public class ThreadInfo implements IThreadInfo { public IThreadFrame getTopFrame() { return fTopFrame; } public String getDetails() { return fDetails; } public String getState() { return fState; } - - - - }