Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF3
-rw-r--r--debug/org.eclipse.cdt.debug.ui/plugin.properties7
-rw-r--r--debug/org.eclipse.cdt.debug.ui/plugin.xml510
-rw-r--r--debug/org.eclipse.cdt.debug.ui/pom.xml2
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java180
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java19
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CRegisterManagerProxies.java88
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/EvaluationContextManager.java241
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties16
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java339
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java436
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BinaryVariableFormatActionDelegate.java26
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CanFormatObjectTester.java45
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java26
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java29
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java159
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java26
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllActionDelegate.java105
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java34
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java26
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NumberFormatsContribution.java121
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RemoveAllGlobalsActionDelegate.java137
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RemoveGlobalsActionDelegate.java125
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java32
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java32
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java16
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java150
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java24
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/BreakpointsMessages.properties3
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointFilteringPage.java81
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java37
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java18
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ThreadFilterEditor.java348
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java5
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/AbstractRegisterGroupCommandHandler.java169
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/AddRegisterGroupCommandHandler.java45
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/EditRegisterGroupCommandHandler.java45
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/LoadAllSymbolsCommandHandler.java37
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/LoadSymbolsCommandHandler.java38
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/RemoveRegisterGroupsCommandHandler.java45
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/RestoreRegisterGroupsCommandHandler.java45
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ViewMemoryHandler.java77
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/CDIDisassemblyRetrieval.java121
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java709
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdiFactory.java42
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/editor/DisassemblyEditor.java379
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyAnnotationModel.java215
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyEditorInput.java366
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMemoryRendering.java103
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMessages.java33
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMessages.properties0
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyRenderingTypeDelegate.java27
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementAdapterFactory.java191
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementLabelProviderFactory.java65
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementProxyFactory.java63
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugTargetContentProvider.java68
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDefaultViewerInputProvider.java54
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerContentProvider.java58
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerModelProxy.java51
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerProxy.java152
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerProxyMementoProvider.java33
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameContentProvider.java55
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameMementoProvider.java46
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameViewerInputProvider.java49
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CThreadContentProvider.java55
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CVariableLabelProvider.java135
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CWatchExpressionFactoryAdapter.java35
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CWatchExpressionFactoryAdapterFactory.java43
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DefaultViewColumnPresentationFactory.java35
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementContentProvider.java126
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementLabelProvider.java148
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementProxy.java88
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyToggleBreakpointAdapter.java92
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/ElementAdapterMessages.java28
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/ElementAdapterMessages.properties13
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/RegistersViewColumnPresentation.java114
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/RegistersViewColumnPresentationFactory.java40
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java111
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java90
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/DebuggerTypesPage.java266
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties6
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java53
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/modules/ModuleMementoProvider.java88
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsContentProvider.java53
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java241
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java90
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java9
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java5
88 files changed, 18 insertions, 8773 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
index 2f0121e15a..cb17d04476 100644
--- a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui; singleton:=true
-Bundle-Version: 7.5.0.qualifier
+Bundle-Version: 8.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.debug.ui.CDebugUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -17,7 +17,6 @@ Export-Package:
org.eclipse.cdt.debug.internal.ui.disassembly.commands;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.disassembly.dsf;x-friends:="org.eclipse.cdt.dsf.ui",
org.eclipse.cdt.debug.internal.ui.disassembly.editor;x-internal:=true,
- org.eclipse.cdt.debug.internal.ui.disassembly.rendering;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.disassembly.viewer;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.editors;x-internal:=true,
org.eclipse.cdt.debug.internal.ui.elements.adapters;x-internal:=true,
diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.properties b/debug/org.eclipse.cdt.debug.ui/plugin.properties
index 322d0a9cbb..9c798eda52 100644
--- a/debug/org.eclipse.cdt.debug.ui/plugin.properties
+++ b/debug/org.eclipse.cdt.debug.ui/plugin.properties
@@ -29,7 +29,6 @@ CDebuggerPage.name=C Debugger UI Page
MemoryPreferencePage.name=Memory View
CDebugPreferencePage.name=Debug
SourcePreferencePage.name=Source Lookup Path
-DebuggerTypesPreferencePage.name=Debugger Types
BreakpointActionPage.name=Breakpoint Action UI Page
RunMenu.label=&Run
@@ -103,12 +102,6 @@ RestoreDefaultTypeAction.tooltip=Restore Original Type Of Variable
CastToArrayAction.label=Display As Array...
CastToArrayAction.tooltip=Display Variable As Array
-EnableVariablesAction.label=Enable
-EnableVariablesAction.tooltip=Enable Selected Variables
-
-DisableVariablesAction.label=Disable
-DisableVariablesAction.tooltip=Disable Selected Variables
-
DefaultSourceLocator.name=Default C/C++ Source Locator
OldDefaultSourceLocator.name=Default C/C++ Source Locator (old)
diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml
index 6e970e573c..d31bd8b93a 100644
--- a/debug/org.eclipse.cdt.debug.ui/plugin.xml
+++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml
@@ -246,11 +246,6 @@
class="org.eclipse.cdt.debug.internal.ui.preferences.SourcePreferencePage"
id="org.eclipse.cdt.debug.ui.SourcePreferencePage">
</page>
- <page
- category="org.eclipse.cdt.debug.ui.CDebugPreferencePage"
- class="org.eclipse.cdt.debug.internal.ui.preferences.DebuggerTypesPage"
- id="org.eclipse.cdt.debug.ui.DebuggerTypesPreferencePage"
- name="%DebuggerTypesPreferencePage.name"/>
</extension>
<extension
point="org.eclipse.ui.actionSets">
@@ -327,37 +322,6 @@
<extension
point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="popup:org.eclipse.debug.ui.ExpressionView?after=additions">
- <menu
- id="org.eclipse.cdt.debug.ui.expressionsView_CVariableFormatMenu"
- label="%CVariableFormatMenu.label">
- <visibleWhen>
- <reference definitionId="org.eclipse.cdt.debug.ui.testAreNumberFormatsSupported"/>
- </visibleWhen>
- <dynamic
- id="org.eclipse.cdt.debug.ui.numberFormats"
- class="org.eclipse.cdt.debug.internal.ui.actions.NumberFormatsContribution">
- </dynamic>
- <separator name="formatGroup" visible="false"/>
- </menu>
- </menuContribution>
- <menuContribution
- locationURI="popup:org.eclipse.debug.ui.VariableView?after=variableGroup">
- <menu
- id="org.eclipse.cdt.debug.ui.CVariableFormatMenu"
- label="%CVariableFormatMenu.label">
- <visibleWhen>
- <reference definitionId="org.eclipse.cdt.debug.ui.testAreNumberFormatsSupported"/>
- </visibleWhen>
- <dynamic
- id="org.eclipse.cdt.debug.ui.numberFormats"
- class="org.eclipse.cdt.debug.internal.ui.actions.NumberFormatsContribution">
- </dynamic>
- <separator name="formatGroup" visible="false"/>
-
- </menu>
- </menuContribution>
<menuContribution
locationURI="popup:org.eclipse.debug.ui.VariableView?after=variableGroup">
<command
@@ -365,44 +329,6 @@
label="%command.viewMemory.name">
</command>
</menuContribution>
- <menuContribution
- locationURI="popup:org.eclipse.debug.ui.RegisterView?after=variableGroup">
- <menu
- id="org.eclipse.cdt.debug.ui.registerView_CVariableFormatMenu"
- label="%CVariableFormatMenu.label">
- <visibleWhen>
- <reference definitionId="org.eclipse.cdt.debug.ui.testAreNumberFormatsSupported"/>
- </visibleWhen>
- <dynamic
- id="org.eclipse.cdt.debug.ui.numberFormats"
- class="org.eclipse.cdt.debug.internal.ui.actions.NumberFormatsContribution">
- </dynamic>
- <separator name="formatGroup" visible="false"/>
- </menu>
- </menuContribution>
- </extension>
- <extension point="org.eclipse.core.expressions.definitions">
- <definition
- id="org.eclipse.cdt.debug.ui.testAreNumberFormatsSupported">
- <with variable="selection">
- <count
- value="+">
- </count>
- <iterate>
- <test property="org.eclipse.cdt.debug.ui.canFormatObject" value="true"/>
- </iterate>
- </with>
- </definition>
- </extension>
-
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- namespace="org.eclipse.cdt.debug.ui"
- properties="canFormatObject"
- type="org.eclipse.core.runtime.IAdaptable"
- class="org.eclipse.cdt.debug.internal.ui.actions.CanFormatObjectTester"
- id="org.eclipse.cdt.debug.ui.canFormatObjectTester">
- </propertyTester>
</extension>
<extension
@@ -691,79 +617,6 @@
id="org.eclipse.cdt.debug.ui.actions.ToggleWatchpointAction"/>
</objectContribution>
<viewerContribution
- targetID="org.eclipse.debug.ui.VariableView"
- id="org.eclipse.debug.ui.variablesView.popupMenu">
- <action
- helpContextId="remove_all_globals_action_context"
- enablesFor="*"
- label="%RemoveAllGlobalsAction.label"
- tooltip="%RemoveAllGlobalsAction.tooltip"
- icon="icons/elcl16/rem_all_co.gif"
- class="org.eclipse.cdt.debug.internal.ui.actions.RemoveAllGlobalsActionDelegate"
- menubarPath="additions"
- id="org.eclipse.cdt.debug.internal.ui.actions.RemoveAllGlobalsActionDelegate">
- <enablement>
- <pluginState
- value="activated"
- id="org.eclipse.cdt.debug.ui"/>
- </enablement>
- </action>
- <action
- helpContextId="remove_globals_action_context"
- enablesFor="+"
- label="%RemoveGlobalsAction.label"
- tooltip="%RemoveGlobalsAction.tooltip"
- icon="icons/elcl16/rem_co.gif"
- class="org.eclipse.cdt.debug.internal.ui.actions.RemoveGlobalsActionDelegate"
- menubarPath="additions"
- id="org.eclipse.cdt.debug.internal.ui.actions.RemoveGlobalsActionDelegate">
- <enablement>
- <pluginState
- value="activated"
- id="org.eclipse.cdt.debug.ui"/>
- </enablement>
- </action>
- <action
- helpContextId="add_globals_action_context"
- label="%AddGlobalsAction.label"
- class="org.eclipse.cdt.debug.internal.ui.actions.AddGlobalsActionDelegate"
- icon="icons/elcl16/watch_globals.gif"
- menubarPath="additions"
- id="org.eclipse.cdt.debug.internal.ui.actions.AddGlobalsActionDelegate">
- <enablement>
- <pluginState
- value="activated"
- id="org.eclipse.cdt.debug.ui"/>
- </enablement>
- </action>
- <action
- label="%DisableVariablesAction.label"
- icon="icons/elcl16/disabled_co.gif"
- helpContextId="disable_variables_action_context"
- tooltip="%DisableVariablesAction.tooltip"
- class="org.eclipse.cdt.debug.internal.ui.actions.DisableVariablesActionDelegate"
- menubarPath="variableGroup"
- enablesFor="2+"
- id="org.eclipse.cdt.debug.internal.ui.actions.DisableVariablesActionDelegate">
- <selection
- class="org.eclipse.cdt.debug.core.model.ICVariable">
- </selection>
- </action>
- <action
- label="%EnableVariablesAction.label"
- icon="icons/elcl16/enabled_co.gif"
- helpContextId="enable_variables_action_context"
- tooltip="%EnableVariablesAction.tooltip"
- class="org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate"
- menubarPath="variableGroup"
- enablesFor="2+"
- id="org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate">
- <selection
- class="org.eclipse.cdt.debug.core.model.ICVariable">
- </selection>
- </action>
- </viewerContribution>
- <viewerContribution
targetID="org.eclipse.debug.ui.RegisterView"
id="org.eclipse.debug.ui.registersView.popupMenu">
<menu
@@ -772,32 +625,6 @@
<separator name="refreshGroup"/>
<separator name="emptyRefreshGroup"/>
</menu>
- <action
- label="%DisableVariablesAction.label"
- icon="icons/elcl16/disabled_co.gif"
- helpContextId="disable_variables_action_context"
- tooltip="%DisableVariablesAction.tooltip"
- class="org.eclipse.cdt.debug.internal.ui.actions.DisableVariablesActionDelegate"
- menubarPath="variableGroup"
- enablesFor="2+"
- id="org.eclipse.cdt.debug.internal.ui.actions.DisableVariablesActionDelegate">
- <selection
- class="org.eclipse.cdt.debug.core.model.ICVariable">
- </selection>
- </action>
- <action
- label="%EnableVariablesAction.label"
- icon="icons/elcl16/enabled_co.gif"
- helpContextId="enable_variables_action_context"
- tooltip="%EnableVariablesAction.tooltip"
- class="org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate"
- menubarPath="variableGroup"
- enablesFor="2+"
- id="org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate">
- <selection
- class="org.eclipse.cdt.debug.core.model.ICVariable">
- </selection>
- </action>
</viewerContribution>
<objectContribution
objectClass="org.eclipse.cdt.debug.core.model.ICModule"
@@ -944,57 +771,6 @@
tooltip="%AddLineBreakpoint.tooltip"/>
</viewContribution>
<viewContribution
- targetID="org.eclipse.debug.ui.VariableView"
- id="org.eclipse.debug.ui.variablesView.toolbar">
- <action
- helpContextId="remove_all_globals_action_context"
- disabledIcon="icons/dlcl16/rem_all_co.gif"
- enablesFor="*"
- toolbarPath="additions"
- label="%RemoveAllGlobalsAction.label"
- tooltip="%RemoveAllGlobalsAction.tooltip"
- icon="icons/elcl16/rem_all_co.gif"
- class="org.eclipse.cdt.debug.internal.ui.actions.RemoveAllGlobalsActionDelegate"
- id="org.eclipse.cdt.debug.internal.ui.actions.RemoveAllGlobalsActionDelegate">
- <enablement>
- <pluginState
- value="activated"
- id="org.eclipse.cdt.debug.ui"/>
- </enablement>
- </action>
- <action
- helpContextId="remove_globals_action_context"
- disabledIcon="icons/dlcl16/rem_co.gif"
- enablesFor="+"
- toolbarPath="additions"
- label="%RemoveGlobalsAction.label"
- tooltip="%RemoveGlobalsAction.tooltip"
- icon="icons/elcl16/rem_co.gif"
- class="org.eclipse.cdt.debug.internal.ui.actions.RemoveGlobalsActionDelegate"
- id="org.eclipse.cdt.debug.internal.ui.actions.RemoveGlobalsActionDelegate">
- <enablement>
- <pluginState
- value="activated"
- id="org.eclipse.cdt.debug.ui"/>
- </enablement>
- </action>
- <action
- helpContextId="add_globals_action_context"
- disabledIcon="icons/dlcl16/watch_globals.gif"
- toolbarPath="additions"
- label="%AddGlobalsAction.label"
- tooltip="%AddGlobalsAction.tooltip"
- icon="icons/elcl16/watch_globals.gif"
- class="org.eclipse.cdt.debug.internal.ui.actions.AddGlobalsActionDelegate"
- id="org.eclipse.cdt.debug.internal.ui.actions.AddGlobalsActionDelegate">
- <enablement>
- <pluginState
- value="activated"
- id="org.eclipse.cdt.debug.ui"/>
- </enablement>
- </action>
- </viewContribution>
- <viewContribution
targetID="org.eclipse.debug.ui.RegisterView"
id="org.eclipse.debug.ui.registersView.toolbar">
<menu
@@ -1180,25 +956,6 @@
</and>
</enabledWhen>
</page>
- <page class="org.eclipse.cdt.debug.internal.ui.breakpoints.CBreakpointFilteringPage"
- id="org.eclipse.cdt.debug.ui.propertypages.breakpoint.filtering"
- name="%FilteringBreakpointPage.label">
- <filter name="debugModelId" value="org.eclipse.cdt.debug.core"/>
- <enabledWhen>
- <and>
- <adapt type="org.eclipse.cdt.debug.core.model.ICBreakpoint">
- </adapt>
- <not>
- <adapt type="org.eclipse.cdt.debug.core.model.ICTracepoint">
- </adapt>
- </not>
- <not>
- <adapt type="org.eclipse.cdt.debug.core.model.ICDynamicPrintf">
- </adapt>
- </not>
- </and>
- </enabledWhen>
- </page>
<page
class="org.eclipse.cdt.debug.internal.ui.propertypages.SignalPropertyPage"
id="org.eclipse.cdt.debug.ui.propertypages.signal.common"
@@ -1344,144 +1101,12 @@
<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
</factory>
<factory
- adaptableType="org.eclipse.cdt.debug.core.model.IModuleRetrieval"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider"/>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICDebugTarget"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory"/>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICThread"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider"/>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICStackFrame"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider"/>
- <adapter type="org.eclipse.cdt.debug.ui.disassembly.IDocumentElementContentProvider"/>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider"/>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICModule"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider">
- </adapter>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider"/>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICModule"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementLabelProviderFactory">
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider">
- </adapter>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.core.model.ICElement"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider">
- </adapter>
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider"/>
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider">
- </adapter>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICVariable"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementLabelProviderFactory">
- <adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider"/>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICSignal"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementLabelProviderFactory">
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider">
- </adapter>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICVariable"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CWatchExpressionFactoryAdapterFactory">
- <adapter
- type="org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter">
- </adapter>
- </factory>
- <factory
adaptableType="org.eclipse.cdt.debug.core.model.provisional.IMemorySpaceAwareMemoryBlockRetrieval"
class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CMemoryAdapterFactory">
<adapter
type="org.eclipse.debug.ui.actions.IAddMemoryBlocksTarget">
</adapter>
</factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.IDisassemblyLine"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter
- type="org.eclipse.cdt.debug.ui.disassembly.IDocumentElementLabelProvider">
- </adapter>
- <adapter
- type="org.eclipse.cdt.debug.ui.disassembly.IDocumentElementAnnotationProvider">
- </adapter>
- <adapter
- type="org.eclipse.cdt.debug.ui.disassembly.IElementToggleBreakpointAdapter">
- </adapter>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.internal.core.model.DisassemblyRetrieval"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory">
- </adapter>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICStackFrame"
- class="org.eclipse.cdt.debug.internal.ui.actions.RetargettableActionAdapterFactory">
- <adapter
- type="org.eclipse.cdt.debug.core.model.IResumeWithoutSignalHandler">
- </adapter>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICThread"
- class="org.eclipse.cdt.debug.internal.ui.actions.RetargettableActionAdapterFactory">
- <adapter
- type="org.eclipse.cdt.debug.core.model.IResumeWithoutSignalHandler">
- </adapter>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.core.model.ICDebugTarget"
- class="org.eclipse.cdt.debug.internal.ui.actions.RetargettableActionAdapterFactory">
- <adapter
- type="org.eclipse.cdt.debug.core.model.IResumeWithoutSignalHandler">
- </adapter>
- </factory>
- <factory
- adaptableType="org.eclipse.cdt.debug.internal.ui.elements.adapters.CRegisterManagerProxy"
- class="org.eclipse.cdt.debug.internal.ui.elements.adapters.CDebugElementAdapterFactory">
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory">
- </adapter>
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider">
- </adapter>
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory">
- </adapter>
- <adapter
- type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider">
- </adapter>
- </factory>
</extension>
<extension
point="org.eclipse.ui.themes">
@@ -1506,22 +1131,6 @@
<initializer class="org.eclipse.cdt.debug.internal.ui.CDebugUIPreferenceInitializer"/>
</extension>
<extension
- point="org.eclipse.debug.ui.memoryRenderings">
- <renderingBindings
- defaultIds="org.eclipse.debug.ui.rendering.raw_memory"
- primaryId="org.eclipse.debug.ui.rendering.raw_memory"
- renderingIds="org.eclipse.debug.ui.rendering.raw_memory,org.eclipse.debug.ui.rendering.ascii,org.eclipse.debug.ui.rendering.signedint,org.eclipse.debug.ui.rendering.unsignedint,org.eclipse.debug.ui.rendering.hexint">
- <enablement>
- <instanceof value="org.eclipse.cdt.debug.internal.core.model.CMemoryBlockExtension"/>
- </enablement>
- </renderingBindings>
- <renderingType
- class="org.eclipse.cdt.debug.internal.ui.disassembly.rendering.DisassemblyRenderingTypeDelegate"
- id="org.eclipse.cdt.debug.ui.rendering.disassembly"
- name="%DisassemblyRendering.name">
- </renderingType>
- </extension>
- <extension
point="org.eclipse.debug.ui.sourceContainerPresentations">
<sourceContainerPresentation
browserClass="org.eclipse.cdt.debug.internal.ui.sourcelookup.CProjectSourceContainerBrowser"
@@ -1590,13 +1199,6 @@
class="org.eclipse.cdt.debug.internal.ui.sourcelookup.CSourceNotFoundEditor"
id="org.eclipse.cdt.debug.ui.SourceNotFoundEditor">
</editor>
- <editor
- class="org.eclipse.cdt.debug.internal.ui.disassembly.editor.DisassemblyEditor"
- default="false"
- icon="icons/obj16/disassembly_obj.gif"
- id="org.eclipse.cdt.debug.ui.disassemblyEditor"
- name="%DisassemblyEditor.name">
- </editor>
</extension>
<!-- Breakpoint Action UI -->
<extension
@@ -2033,104 +1635,6 @@
<extension
point="org.eclipse.ui.handlers">
<handler
- class="org.eclipse.cdt.debug.internal.ui.commands.AddRegisterGroupCommandHandler"
- commandId="org.eclipse.cdt.debug.ui.command.addRegisterGroup">
- <activeWhen>
- <with variable="selection">
- <iterate operator="and">
- <or>
- <instanceof
- value="org.eclipse.cdt.debug.internal.core.model.CRegisterGroup">
- </instanceof>
- <instanceof
- value="org.eclipse.cdt.debug.internal.core.model.CRegister">
- </instanceof>
- </or>
- </iterate>
- <count value="+">
- </count>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.cdt.debug.internal.ui.commands.EditRegisterGroupCommandHandler"
- commandId="org.eclipse.cdt.debug.ui.command.editRegisterGroup">
- <activeWhen>
- <with variable="selection">
- <iterate operator="and">
- <instanceof
- value="org.eclipse.cdt.debug.internal.core.model.CRegisterGroup">
- </instanceof>
- </iterate>
- <count value="1">
- </count>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.cdt.debug.internal.ui.commands.RestoreRegisterGroupsCommandHandler"
- commandId="org.eclipse.cdt.debug.ui.command.restoreRegisterGroups">
- <activeWhen>
- <with variable="selection">
- <iterate operator="and">
- <or>
- <instanceof
- value="org.eclipse.cdt.debug.internal.core.model.CRegisterGroup">
- </instanceof>
- <instanceof
- value="org.eclipse.cdt.debug.internal.core.model.CRegister">
- </instanceof>
- </or>
- </iterate>
- <count value="+">
- </count>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.cdt.debug.internal.ui.commands.RemoveRegisterGroupsCommandHandler"
- commandId="org.eclipse.cdt.debug.ui.command.removeRegisterGroups">
- <activeWhen>
- <with variable="selection">
- <iterate operator="and">
- <instanceof
- value="org.eclipse.cdt.debug.internal.core.model.CRegisterGroup">
- </instanceof>
- </iterate>
- <count value="+">
- </count>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.cdt.debug.internal.ui.commands.LoadSymbolsCommandHandler"
- commandId="org.eclipse.cdt.debug.ui.command.loadSymbols">
- <activeWhen>
- <with variable="selection">
- <iterate operator="and">
- <instanceof value="org.eclipse.cdt.debug.core.model.ICModule">
- </instanceof>
- </iterate>
- <count value="+">
- </count>
- </with>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.cdt.debug.internal.ui.commands.LoadAllSymbolsCommandHandler"
- commandId="org.eclipse.cdt.debug.ui.command.loadAllSymbols">
- <activeWhen>
- <with variable="selection">
- <iterate operator="and">
- <instanceof value="org.eclipse.cdt.debug.core.model.ICModule">
- </instanceof>
- </iterate>
- <count value="+">
- </count>
- </with>
- </activeWhen>
- </handler>
- <handler
class="org.eclipse.cdt.debug.internal.ui.commands.ReverseToggleCommandHandler"
commandId="org.eclipse.cdt.debug.ui.command.reverseToggle">
</handler>
@@ -2168,20 +1672,6 @@
helpContextId="resume_without_signal_action_context">
</handler>
<handler
- class="org.eclipse.cdt.debug.internal.ui.commands.ViewMemoryHandler"
- commandId="org.eclipse.cdt.debug.ui.commands.viewMemory">
- <activeWhen>
- <with variable="selection">
- <iterate operator="and">
- <instanceof value="org.eclipse.cdt.debug.core.model.ICVariable">
- </instanceof>
- </iterate>
- <count value="+">
- </count>
- </with>
- </activeWhen>
- </handler>
- <handler
class="org.eclipse.cdt.debug.internal.ui.commands.GroupDebugContextsCommandHandler"
commandId="org.eclipse.cdt.debug.ui.command.groupDebugContexts">
</handler>
diff --git a/debug/org.eclipse.cdt.debug.ui/pom.xml b/debug/org.eclipse.cdt.debug.ui/pom.xml
index a9582cb41c..4afb7b550b 100644
--- a/debug/org.eclipse.cdt.debug.ui/pom.xml
+++ b/debug/org.eclipse.cdt.debug.ui/pom.xml
@@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>7.5.0-SNAPSHOT</version>
+ <version>8.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.debug.ui</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java
index 3b4195fe38..f142f4d801 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugModelPresentation.java
@@ -24,35 +24,20 @@ import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.resources.FileStorage;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.CDebugUtils;
-import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit;
-import org.eclipse.cdt.debug.core.cdi.ICDIEventBreakpointHit;
-import org.eclipse.cdt.debug.core.cdi.ICDIExitInfo;
-import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryEvent;
-import org.eclipse.cdt.debug.core.cdi.ICDISignalExitInfo;
-import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived;
-import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointScope;
-import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger;
-import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
-import org.eclipse.cdt.debug.core.model.CDebugElementState;
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
import org.eclipse.cdt.debug.core.model.ICBreakpointType;
-import org.eclipse.cdt.debug.core.model.ICDebugElement;
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
+import org.eclipse.cdt.debug.core.model.ICDynamicPrintf;
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
-import org.eclipse.cdt.debug.core.model.ICGlobalVariable;
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
import org.eclipse.cdt.debug.core.model.ICModule;
-import org.eclipse.cdt.debug.core.model.ICDynamicPrintf;
import org.eclipse.cdt.debug.core.model.ICSignal;
import org.eclipse.cdt.debug.core.model.ICStackFrame;
-import org.eclipse.cdt.debug.core.model.ICThread;
import org.eclipse.cdt.debug.core.model.ICTracepoint;
import org.eclipse.cdt.debug.core.model.ICType;
import org.eclipse.cdt.debug.core.model.ICValue;
-import org.eclipse.cdt.debug.core.model.ICVariable;
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
import org.eclipse.cdt.debug.core.model.IDummyStackFrame;
import org.eclipse.cdt.debug.core.model.IEnableDisableTarget;
@@ -80,13 +65,10 @@ import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IDisconnect;
import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IRegister;
import org.eclipse.debug.core.model.IRegisterGroup;
import org.eclipse.debug.core.model.IStackFrame;
import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
import org.eclipse.debug.core.model.IWatchExpression;
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
import org.eclipse.debug.ui.DebugUITools;
@@ -272,42 +254,12 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
}
if ( element instanceof IWatchExpression && ((IWatchExpression)element).hasErrors() )
overlays[OverlayImageDescriptor.BOTTOM_LEFT] = CDebugImages.DESC_OVRS_ERROR;
- if ( element instanceof ICVariable && ((ICVariable)element).isArgument() )
- overlays[OverlayImageDescriptor.TOP_RIGHT] = CDebugImages.DESC_OVRS_ARGUMENT;
- if ( element instanceof ICGlobalVariable && !(element instanceof IRegister) )
- overlays[OverlayImageDescriptor.TOP_RIGHT] = CDebugImages.DESC_OVRS_GLOBAL;
return getImageCache().getImageFor( new OverlayImageDescriptor( baseImage, overlays ) );
}
return null;
}
private Image getBaseImage( Object element ) {
- if ( element instanceof ICDebugTarget ) {
- ICDebugTarget target = (ICDebugTarget)element;
- if ( target.isPostMortem() ) {
- return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_TERMINATED ) );
- }
- if ( target.isTerminated() || target.isDisconnected() ) {
- return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_TERMINATED ) );
- }
- return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_DEBUG_TARGET ) );
- }
- if ( element instanceof ICThread ) {
- ICThread thread = (ICThread)element;
- ICDebugTarget target = (ICDebugTarget)thread.getDebugTarget();
- if ( target.isPostMortem() ) {
- return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_THREAD_TERMINATED ) );
- }
- if ( thread.isSuspended() ) {
- return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED ) );
- }
- else if ( thread.isTerminated() ) {
- return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_THREAD_TERMINATED ) );
- }
- else {
- return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_THREAD_RUNNING ) );
- }
- }
if ( element instanceof IMarker ) {
IBreakpoint bp = getBreakpoint( (IMarker)element );
if ( bp != null && bp instanceof ICBreakpoint ) {
@@ -323,12 +275,6 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
if ( element instanceof IExpression ) {
return getExpressionImage( (IExpression)element );
}
- if ( element instanceof IRegister ) {
- return getRegisterImage( (IRegister)element );
- }
- if ( element instanceof IVariable ) {
- return getVariableImage( (IVariable)element );
- }
if ( element instanceof ICModule ) {
return getModuleImage( (ICModule)element );
}
@@ -485,10 +431,6 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
if ( element instanceof IWatchExpression ) {
return getWatchExpressionText( (IWatchExpression)element );
}
- if ( element instanceof IVariable ) {
- label.append( getVariableText( (IVariable)element ) );
- return label.toString();
- }
if ( element instanceof IValue ) {
label.append( getValueText( (IValue)element ) );
return label.toString();
@@ -518,8 +460,6 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
}
if ( element instanceof IDebugTarget )
label.append( getTargetText( (IDebugTarget)element, showQualified ) );
- else if ( element instanceof IThread )
- label.append( getThreadText( (IThread)element, showQualified ) );
if ( element instanceof ITerminate ) {
if ( ((ITerminate)element).isTerminated() ) {
label.insert( 0, CDebugUIMessages.getString( "CDTDebugModelPresentation.0" ) ); //$NON-NLS-1$
@@ -615,30 +555,6 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
return overlays;
}
-
- protected Image getVariableImage( IVariable element ) {
- if ( element instanceof ICVariable ) {
- ICType type = null;
- try {
- type = ((ICVariable)element).getType();
- }
- catch( DebugException e ) {
- // use default image
- }
- if ( type != null && (type.isPointer() || type.isReference()) )
- return fDebugImageRegistry.get( (((ICVariable)element).isEnabled()) ? CDebugImages.DESC_OBJS_VARIABLE_POINTER : CDebugImages.DESC_OBJS_VARIABLE_POINTER_DISABLED );
- else if ( type != null && (type.isArray() || type.isStructure()) )
- return fDebugImageRegistry.get( (((ICVariable)element).isEnabled()) ? CDebugImages.DESC_OBJS_VARIABLE_AGGREGATE : CDebugImages.DESC_OBJS_VARIABLE_AGGREGATE_DISABLED );
- else
- return fDebugImageRegistry.get( (((ICVariable)element).isEnabled()) ? CDebugImages.DESC_OBJS_VARIABLE_SIMPLE : CDebugImages.DESC_OBJS_VARIABLE_SIMPLE_DISABLED );
- }
- return null;
- }
-
- protected Image getRegisterImage( IRegister element ) {
- return ( ( element instanceof ICVariable && ((ICVariable)element).isEnabled() ) ) ? fDebugImageRegistry.get( CDebugImages.DESC_OBJS_REGISTER ) : fDebugImageRegistry.get( CDebugImages.DESC_OBJS_REGISTER_DISABLED );
- }
-
protected Image getExpressionImage( IExpression element ) {
return fDebugImageRegistry.get( DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_OBJS_EXPRESSION ) );
}
@@ -659,34 +575,6 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
return null;
}
- protected String getVariableText( IVariable var ) throws DebugException {
- StringBuffer label = new StringBuffer();
- if ( var instanceof ICVariable ) {
- ICType type = null;
- try {
- type = ((ICVariable)var).getType();
- }
- catch( DebugException e ) {
- // don't display type
- }
- if ( type != null && isShowVariableTypeNames() ) {
- String typeName = CDebugUIUtils.getVariableTypeName( type );
- if ( typeName != null && typeName.length() > 0 ) {
- label.append( typeName ).append( ' ' );
- }
- }
- String name = var.getName();
- if ( name != null )
- label.append( name.trim() );
- String valueString = getValueText( var.getValue() );
- if ( !isEmpty( valueString ) ) {
- label.append( " = " ); //$NON-NLS-1$
- label.append( valueString );
- }
- }
- return label.toString();
- }
-
protected String getValueText( IValue value ) {
return CDebugUIUtils.getValueText( value );
}
@@ -739,75 +627,9 @@ public class CDebugModelPresentation extends LabelProvider implements IDebugMode
}
protected String getTargetText( IDebugTarget target, boolean qualified ) throws DebugException {
- ICDebugTarget t = target.getAdapter( ICDebugTarget.class );
- if ( t != null ) {
- if ( !t.isPostMortem() ) {
- CDebugElementState state = t.getState();
- if ( state.equals( CDebugElementState.EXITED ) || state.equals( CDebugElementState.TERMINATED )) {
- Object info = t.getCurrentStateInfo();
- String label = CDebugUIMessages.getString( "CDTDebugModelPresentation.3" ); //$NON-NLS-1$
- String reason = ""; //$NON-NLS-1$
- if ( info != null && info instanceof ICDISignalExitInfo ) {
- ICDISignalExitInfo sigInfo = (ICDISignalExitInfo)info;
- reason = ' ' + MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.5" ), sigInfo.getName(), sigInfo.getDescription() ); //$NON-NLS-1$
- }
- else if ( info != null && info instanceof ICDIExitInfo ) {
- reason = ' ' + MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.6" ), Integer.valueOf( ((ICDIExitInfo)info).getCode() ) ); //$NON-NLS-1$
- }
- return MessageFormat.format( label, target.getName(), reason );
- }
- else if ( state.equals( CDebugElementState.SUSPENDED ) ) {
- return MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.7" ), target.getName() ); //$NON-NLS-1$
- }
- }
- }
return target.getName();
}
- protected String getThreadText( IThread thread, boolean qualified ) throws DebugException {
- ICDebugTarget target = thread.getDebugTarget().getAdapter( ICDebugTarget.class );
- if ( target.isPostMortem() ) {
- return getFormattedString( CDebugUIMessages.getString( "CDTDebugModelPresentation.8" ), thread.getName() ); //$NON-NLS-1$
- }
- if ( thread.isTerminated() ) {
- return getFormattedString( CDebugUIMessages.getString( "CDTDebugModelPresentation.9" ), thread.getName() ); //$NON-NLS-1$
- }
- if ( thread.isStepping() ) {
- return getFormattedString( CDebugUIMessages.getString( "CDTDebugModelPresentation.10" ), thread.getName() ); //$NON-NLS-1$
- }
- if ( !thread.isSuspended() ) {
- return getFormattedString( CDebugUIMessages.getString( "CDTDebugModelPresentation.11" ), thread.getName() ); //$NON-NLS-1$
- }
- if ( thread.isSuspended() ) {
- String reason = ""; //$NON-NLS-1$
- ICDebugElement element = thread.getAdapter( ICDebugElement.class );
- if ( element != null ) {
- Object info = element.getCurrentStateInfo();
- if ( info instanceof ICDISignalReceived ) {
- ICDISignal signal = ((ICDISignalReceived)info).getSignal();
- reason = MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.13" ), signal.getName(), signal.getDescription() ); //$NON-NLS-1$
- }
- else if ( info instanceof ICDIWatchpointTrigger ) {
- reason = MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.14" ), ((ICDIWatchpointTrigger)info).getOldValue(), ((ICDIWatchpointTrigger)info).getNewValue() ); //$NON-NLS-1$
- }
- else if ( info instanceof ICDIWatchpointScope ) {
- reason = CDebugUIMessages.getString( "CDTDebugModelPresentation.15" ); //$NON-NLS-1$
- }
- else if ( info instanceof ICDIBreakpointHit ) {
- reason = CDebugUIMessages.getString( "CDTDebugModelPresentation.16" ); //$NON-NLS-1$
- }
- else if ( info instanceof ICDISharedLibraryEvent ) {
- reason = CDebugUIMessages.getString( "CDTDebugModelPresentation.17" ); //$NON-NLS-1$
- }
- else if ( info instanceof ICDIEventBreakpointHit ) {
- reason = MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.20" ), ((ICDIEventBreakpointHit)info).getEventBreakpointType() ); //$NON-NLS-1$
- }
- }
- return MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.18" ), thread.getName(), reason ); //$NON-NLS-1$
- }
- return MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.19" ), thread.getName() ); //$NON-NLS-1$
- }
-
protected String getStackFrameText( IStackFrame f, boolean qualified ) throws DebugException {
if ( f instanceof ICStackFrame ) {
ICStackFrame frame = (ICStackFrame)f;
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
index 977412ba9c..db8c69f07b 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
@@ -14,14 +14,12 @@ package org.eclipse.cdt.debug.internal.ui;
import java.net.URI;
import java.util.Iterator;
-import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.cdt.debug.core.model.ICType;
import org.eclipse.cdt.debug.core.model.ICValue;
import org.eclipse.cdt.debug.core.model.IEnableDisableTarget;
-import org.eclipse.cdt.debug.internal.ui.disassembly.rendering.DisassemblyEditorInput;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.debug.ui.breakpoints.CBreakpointPropertyDialogAction;
import org.eclipse.core.filesystem.URIUtil;
@@ -146,16 +144,6 @@ public class CDebugUIUtils {
valueString = "."; //$NON-NLS-1$
label.append( valueString );
}
- else if ( type != null && type.isFloatingPointType() ) {
- Number floatingPointValue = CDebugUtils.getFloatingPointValue( (ICValue)value );
- if ( CDebugUtils.isNaN( floatingPointValue ) )
- valueString = "NAN"; //$NON-NLS-1$
- if ( CDebugUtils.isPositiveInfinity( floatingPointValue ) )
- valueString = CDebugUIMessages.getString( "CDTDebugModelPresentation.23" ); //$NON-NLS-1$
- if ( CDebugUtils.isNegativeInfinity( floatingPointValue ) )
- valueString = CDebugUIMessages.getString( "CDTDebugModelPresentation.24" ); //$NON-NLS-1$
- label.append( valueString );
- }
else if ( valueString.length() > 0 ) {
label.append( valueString );
}
@@ -221,13 +209,6 @@ public class CDebugUIUtils {
if ( input instanceof IPathEditorInput ) {
return ((IPathEditorInput)input).getPath().toOSString();
}
- if ( input instanceof DisassemblyEditorInput ) {
- String sourceFile = ((DisassemblyEditorInput)input).getSourceFile();
- if ( sourceFile != null ) {
- return sourceFile;
- }
- return ((DisassemblyEditorInput)input).getModuleFile();
- }
if ( input instanceof IURIEditorInput)
{
IPath uriPath = URIUtil.toPath(((IURIEditorInput)input).getURI());
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CRegisterManagerProxies.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CRegisterManagerProxies.java
deleted file mode 100644
index e746c9bf6c..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CRegisterManagerProxies.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.cdt.debug.core.model.ICDebugElement;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
-import org.eclipse.cdt.debug.internal.ui.elements.adapters.CRegisterManagerProxy;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.IDebugContextManager;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Singleton that keeps track of <code>CRegisterManagerProxy</code> objects
- */
-public class CRegisterManagerProxies {
-
- private static CRegisterManagerProxies fgInstance = new CRegisterManagerProxies();
-
- private Map<ICDebugTarget, CRegisterManagerProxy> fMap;
-
- public static CRegisterManagerProxies getInstance() {
- return fgInstance;
- }
-
- public CRegisterManagerProxies() {
- super();
- fMap = new HashMap<ICDebugTarget, CRegisterManagerProxy>();
- }
-
- public void dispose() {
- for ( CRegisterManagerProxy proxy : fMap.values() ) {
- DebugPlugin.getDefault().removeDebugEventListener( proxy );
- proxy.dispose();
- }
- fMap.clear();
- }
-
- public CRegisterManagerProxy getRegisterManagerProxy( ICDebugTarget target ) {
- CRegisterManagerProxy proxy = fMap.get( target );
- if ( proxy == null ) {
- synchronized( this ) {
- proxy = fMap.get( target );
- if ( proxy == null ) {
- proxy = new CRegisterManagerProxy( ((CDebugTarget)target).getRegisterManager() );
- DebugPlugin.getDefault().addDebugEventListener( proxy );
- IDebugContextService service = getContextService();
- if ( service != null ) {
- ISelection s = service.getActiveContext();
- if ( s instanceof IStructuredSelection && ((IStructuredSelection)s).size() == 1 ) {
- Object context = ((IStructuredSelection)s).getFirstElement();
- proxy.setContext( ( context instanceof ICDebugElement ) ? (ICDebugElement)context : target );
- }
- service.addDebugContextListener( proxy );
- }
- fMap.put( target, proxy );
- }
- }
- }
- return proxy;
- }
-
- private IDebugContextService getContextService() {
- IWorkbenchWindow window = SelectedResourceManager.getDefault().getActiveWindow();
- if ( window != null ) {
- IDebugContextManager manager = DebugUITools.getDebugContextManager();
- return manager.getContextService( window );
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/EvaluationContextManager.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/EvaluationContextManager.java
deleted file mode 100644
index a4d554637e..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/EvaluationContextManager.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IPageListener;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Manages the current evaluation context (stack frame) for evaluation actions.
- * In each page, the selection is tracked in each debug view (if any). When a debug
- * target selection exists, the "debuggerActive" System property is set to true.
- * This property is used to make the "Run to Line" and "Resume at Line" actions
- * visible in editors only if there is a running debug session.
- */
-public class EvaluationContextManager implements IWindowListener, IPageListener, ISelectionListener, IPartListener2 {
- private final static String DEBUGGER_ACTIVE = CDebugUIPlugin.getUniqueIdentifier() + ".debuggerActive"; //$NON-NLS-1$
- protected static EvaluationContextManager fgManager;
- private Map<IWorkbenchPage, ICDebugTarget> fContextsByPage = null;
-
- protected EvaluationContextManager() {
- }
-
- public static void startup() {
- Runnable r = new Runnable() {
- @Override
- public void run() {
- if (fgManager == null) {
- fgManager = new EvaluationContextManager();
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- fgManager.windowOpened(windows[i]);
- }
- workbench.addWindowListener(fgManager);
- }
- }
- };
- CDebugUIPlugin.getStandardDisplay().asyncExec(r);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
- @Override
- public void windowActivated(IWorkbenchWindow window) {
- windowOpened(window);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
- @Override
- public void windowDeactivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
- @Override
- public void windowClosed(IWorkbenchWindow window) {
- window.removePageListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
- @Override
- public void windowOpened(IWorkbenchWindow window) {
- IWorkbenchPage[] pages = window.getPages();
- for(int i = 0; i < pages.length; i++) {
- window.addPageListener(this);
- pageOpened(pages[i]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageActivated(org.eclipse.ui.IWorkbenchPage)
- */
- @Override
- public void pageActivated(IWorkbenchPage page) {
- pageOpened(page);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage)
- */
- @Override
- public void pageClosed(IWorkbenchPage page) {
- page.removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- page.removePartListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageOpened(org.eclipse.ui.IWorkbenchPage)
- */
- @Override
- public void pageOpened(IWorkbenchPage page) {
- page.addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- page.addPartListener(this);
- IWorkbenchPartReference ref = page.getActivePartReference();
- if (ref != null) {
- partActivated(ref);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- IWorkbenchPage page = part.getSite().getPage();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- if (ss.size() == 1) {
- Object element = ss.getFirstElement();
- if (element instanceof IAdaptable) {
- ICDebugTarget target = ((IAdaptable)element).getAdapter(ICDebugTarget.class);
- if (target != null) {
- setContext(page, target);
- return;
- }
- }
- }
- }
- // no context in the given view
- removeContext(page);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- @Override
- public void partActivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
- */
- @Override
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
- */
- @Override
- public void partClosed(IWorkbenchPartReference partRef) {
- if (IDebugUIConstants.ID_DEBUG_VIEW.equals(partRef.getId())) {
- removeContext(partRef.getPage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- @Override
- public void partDeactivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
- */
- @Override
- public void partOpened(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
- */
- @Override
- public void partHidden(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
- */
- @Override
- public void partVisible(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
- */
- @Override
- public void partInputChanged(IWorkbenchPartReference partRef) {
- }
-
- /**
- * Sets the evaluation context for the given page, and notes that
- * a valid execution context exists.
- *
- * @param page
- * @param frame
- */
- private void setContext(IWorkbenchPage page, ICDebugTarget target) {
- if (fContextsByPage == null) {
- fContextsByPage = new HashMap<IWorkbenchPage, ICDebugTarget>();
- }
- fContextsByPage.put(page, target);
- System.setProperty(DEBUGGER_ACTIVE, Boolean.TRUE.toString());
- }
-
- /**
- * Removes an evaluation context for the given page, and determines if
- * any valid execution context remain.
- *
- * @param page
- */
- private void removeContext(IWorkbenchPage page) {
- if (fContextsByPage != null) {
- fContextsByPage.remove(page);
- if (fContextsByPage.isEmpty()) {
- System.setProperty(DEBUGGER_ACTIVE, Boolean.FALSE.toString());
- }
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties
index 5e60116ca7..0b4f3ece6a 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties
@@ -19,10 +19,7 @@ LoadSymbolsActionDelegate.Unable_to_load_symbols_of_shared_library_1=Unable to l
LoadSymbolsActionDelegate.Operation_failed_1=Operation failed.
LoadSymbolsForAllAction.Load_Symbols_For_All_1=Load Symbols For All
LoadSymbolsForAllAction.Load_symbols_for_all_shared_libraries_1=Load symbols for all shared libraries.
-LoadSymbolsForAllActionDelegate.Error(s)_occurred_loading_the_symbols_1=Error(s) occurred loading the symbols.
LoadSymbolsForAllAction.Load_Symbols_For_All_2=Load Symbols For All
-LoadSymbolsForAllActionDelegate.Error_1=Error
-LoadSymbolsForAllActionDelegate.0=Operation failed.
LoadModuleSymbolsActionDelegate.0=Unable to load symbols.
LoadSymbolsForAllAction.Unable_to_load_symbols_1=Unable to load symbols.
SignalZeroObjectActionDelegate.0=Unable to resume ignoring the signal.
@@ -64,14 +61,10 @@ MoveToLineAdapter.1=Missing document
MoveToLineAdapter.2=Empty editor
MoveToLineAdapter.3=Operation is not supported.
MoveToLineAdapter.4=Move To Line failed.
-AddGlobalsActionDelegate.title=Global Variables
-AddGlobalsActionDelegate.Error(s)_occured_adding_globals_1=Error(s) occurred adding globals.
ManageFunctionBreakpointActionDelegate.Error_1=Error
ManageFunctionBreakpointActionDelegate.Operation_failed_1=Operation failed.
SignalActionDelegate.0=Unable to deliver the signal to the target.
SignalActionDelegate.1=Operation failed.
-AddGlobalsActionDelegate.0=Select Variables:
-AddGlobalsActionDelegate.1=Add global variables failed.
VariableFormatActionDelegate.0=Unable to set format.
ExpressionDialog.0=Add Watch Expression
ExpressionDialog.1=Expression to watch:
@@ -88,18 +81,9 @@ CastToArrayActionDelegate.5=The 'Length' field must not be empty.
CastToArrayActionDelegate.6=Invalid length.
CastToArrayActionDelegate.7=The length must be greater than 0.
CastToArrayActionDelegate.8=Unable to display this variable as an array.
-EnableVariablesActionDelegate.0=Exceptions occurred enabling the variable(s).
-EnableVariablesActionDelegate.1=Enable variable(s) failed.
AddFunctionBreakpointActionDelegate.0=Cannot add function breakpoint.
AddLineBreakpointActionDelegate.0=Cannot add line breakpoint.
AddWatchpointActionDelegate.0=Cannot add watchpoint.
-AddWatchpointDialog.0=Add Watchpoint
-AddWatchpointDialog.1=Expression to watch:
-AddWatchpointDialog.2=Access
-AddWatchpointDialog.3=Write
-AddWatchpointDialog.4=Read
-AddWatchpointDialog.5=Memory space:
-AddWatchpointDialog.6=Units:
AddWatchpointOnVariableActionDelegate.No_Element_Size=Failed to get variable/expression size
AddWatchpointOnVariableActionDelegate.Error_Dlg_Title=Error
ResumeAtLineAdapter.0=Empty editor
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java
deleted file mode 100644
index c799394ac5..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddGlobalsActionDelegate.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.cdt.debug.core.ICGlobalVariableManager;
-import org.eclipse.cdt.debug.core.model.IExecFileInfo;
-import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.actions.ActionDelegate;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-
-/**
- * A delegate for the "Add Globals" action.
- */
-public class AddGlobalsActionDelegate extends ActionDelegate implements IViewActionDelegate, ISelectionListener, IPartListener {
-
-
- class SortedListSelectionDialog extends ListSelectionDialog {
-
- public SortedListSelectionDialog( Shell parentShell, Object input, IStructuredContentProvider contentProvider, ILabelProvider labelProvider, String message ) {
- super( parentShell, input, contentProvider, labelProvider, message );
- }
-
- @Override
- protected Control createDialogArea( Composite parent ) {
- Control da = super.createDialogArea( parent );
- getViewer().setSorter( new ViewerSorter() );
- return da;
- }
- }
-
- private IGlobalVariableDescriptor[] fGlobals;
-
- private IViewPart fView = null;
-
- private IAction fAction;
-
- private IStructuredSelection fSelection;
-
- private IStatus fStatus = null;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IViewActionDelegate#init(IViewPart)
- */
- @Override
- public void init( IViewPart view ) {
- fView = view;
- view.getSite().getPage().addPartListener( this );
- view.getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
- */
- @Override
- public void selectionChanged( IWorkbenchPart part, ISelection selection ) {
- if ( part != null && part.getSite().getId().equals( IDebugUIConstants.ID_DEBUG_VIEW ) ) {
- if ( selection instanceof IStructuredSelection ) {
- setSelection( (IStructuredSelection)selection );
- }
- else {
- setSelection( null );
- }
- update( getAction() );
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(IAction)
- */
- @Override
- public void run( IAction action ) {
- final IStructuredSelection selection = getSelection();
- if ( selection == null || selection.size() != 1 )
- return;
- BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
-
- @Override
- public void run() {
- try {
- doAction( selection.getFirstElement() );
- setStatus( null );
- }
- catch( DebugException e ) {
- setStatus( e.getStatus() );
- }
- }
- } );
- IStatus status = getStatus();
- if ( status != null && !status.isOK() ) {
- if ( status.isMultiStatus() ) {
- status = new MultiStatus( status.getPlugin(), status.getCode(), status.getChildren(), ActionMessages.getString( "AddGlobalsActionDelegate.Error(s)_occured_adding_globals_1" ), status.getException() ); //$NON-NLS-1$
- }
- IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
- if ( window != null ) {
- CDebugUIPlugin.errorDialog( getErrorDialogMessage(), status );
- }
- else {
- CDebugUIPlugin.log( status );
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
- */
- @Override
- public void selectionChanged( IAction action, ISelection selection ) {
- setAction( action );
- if ( getView() != null ) {
- update( action );
- }
- }
-
- protected void update( IAction action ) {
- if ( action != null ) {
- action.setEnabled( getEnableStateForSelection( getSelection() ) );
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart)
- */
- @Override
- public void partActivated( IWorkbenchPart part ) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- @Override
- public void partBroughtToTop( IWorkbenchPart part ) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart)
- */
- @Override
- public void partClosed( IWorkbenchPart part ) {
- if ( part.equals( getView() ) ) {
- dispose();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart)
- */
- @Override
- public void partDeactivated( IWorkbenchPart part ) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart)
- */
- @Override
- public void partOpened( IWorkbenchPart part ) {
- }
-
- protected IViewPart getView() {
- return fView;
- }
-
- protected void setView( IViewPart viewPart ) {
- fView = viewPart;
- }
-
- protected void setAction( IAction action ) {
- fAction = action;
- }
-
- protected IAction getAction() {
- return fAction;
- }
-
- private void setSelection( IStructuredSelection selection ) {
- fSelection = selection;
- }
-
- private IStructuredSelection getSelection() {
- return fSelection;
- }
-
- @Override
- public void dispose() {
- if ( getView() != null ) {
- getView().getViewSite().getPage().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
- getView().getViewSite().getPage().removePartListener( this );
- }
- }
-
- protected boolean getEnableStateForSelection( IStructuredSelection selection ) {
- if ( selection == null || selection.size() != 1 ) {
- return false;
- }
- Object element = selection.getFirstElement();
- return (element != null && element instanceof IDebugElement && ((IDebugElement)element).getDebugTarget().getAdapter( IExecFileInfo.class ) != null);
- }
-
- private SortedListSelectionDialog createDialog() {
- return new SortedListSelectionDialog( getView().getSite().getShell(), fGlobals, new IStructuredContentProvider() {
-
- @Override
- public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- public Object[] getElements( Object parent ) {
- return getGlobals();
- }
- }, new LabelProvider() {
-
- @Override
- public String getText( Object element ) {
- if ( element instanceof IGlobalVariableDescriptor ) {
- String path = ""; //$NON-NLS-1$
- if ( ((IGlobalVariableDescriptor)element).getPath() != null ) {
- path = ((IGlobalVariableDescriptor)element).getPath().toString();
- int index = path.lastIndexOf( '/' );
- if ( index != -1 )
- path = path.substring( index + 1 );
- }
- return (path.length() > 0 ? ('\'' + path + "\'::") : "") + ((IGlobalVariableDescriptor)element).getName(); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return null;
- }
- }, ActionMessages.getString( "AddGlobalsActionDelegate.0" ) ); //$NON-NLS-1$
- }
-
- protected IGlobalVariableDescriptor[] getGlobals() {
- return fGlobals;
- }
-
- protected void doAction( Object element ) throws DebugException {
- if ( getView() == null )
- return;
- if ( element != null && element instanceof IDebugElement ) {
- IExecFileInfo info = ((IDebugElement)element).getDebugTarget().getAdapter( IExecFileInfo.class );
- ICGlobalVariableManager gvm = ((IDebugElement)element).getDebugTarget().getAdapter( ICGlobalVariableManager.class );
- if ( info != null && gvm != null ) {
- fGlobals = info.getGlobals();
- ListSelectionDialog dlg = createDialog();
- dlg.setTitle(ActionMessages.getString("AddGlobalsActionDelegate.title")); //$NON-NLS-1$
- dlg.setInitialSelections( gvm.getDescriptors() );
- if ( dlg.open() == Window.OK ) {
- List<Object> list = Arrays.asList( dlg.getResult() );
- IGlobalVariableDescriptor[] selections = list.toArray( new IGlobalVariableDescriptor[list.size()] );
- gvm.addGlobals( selections );
- }
- }
- }
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.getString( "AddGlobalsActionDelegate.1" ); //$NON-NLS-1$
- }
-
- protected void setStatus( IStatus status ) {
- fStatus = status;
- }
-
- protected IStatus getStatus() {
- return fStatus;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- @Override
- public void init( IAction action ) {
- super.init( action );
- Object element = DebugUITools.getDebugContext();
- setSelection( (element != null) ? new StructuredSelection( element ) : new StructuredSelection() );
- update( action );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java
deleted file mode 100644
index b33ea98f71..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointDialog.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.cdt.debug.internal.ui.actions;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.cdt.debug.core.cdi.model.ICDIMemorySpaceManagement;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * The "Add Watchpoint" dialog of the "Toggle watchpoint" action.
- * @deprecated Replaced by opening a properties dialog on a new breakpoint.
- */
-public class AddWatchpointDialog extends Dialog implements ModifyListener, SelectionListener {
-
- private Combo fExpressionInput;
- private String fExpression;
- private static List<String> sExpressionHistory = new ArrayList<String>();
-
- private boolean fHasMemorySpaceControls;
- private Button fMemorySpaceEnableButton;
- private Combo fMemorySpaceInput;
- private String fMemorySpace;
-
- private boolean fRangeInitialEnable;
- private Button fRangeEnableButton;
- private Text fRangeField;
- private String fRange = ""; //$NON-NLS-1$
-
- private Button fChkBtnWrite;
- private Button fChkBtnRead;
- private boolean fRead;
- private boolean fWrite;
-
- private ICDIMemorySpaceManagement fMemManagement;
-
-
- /**
- * Constructor for AddWatchpointDialog.
- *
- * @param parentShell
- */
- public AddWatchpointDialog( Shell parentShell, ICDIMemorySpaceManagement memMgmt ) {
- super( parentShell );
- setShellStyle( getShellStyle() | SWT.RESIZE );
- fMemManagement = memMgmt;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea( Composite parent ) {
- // The button bar will work better if we make the parent composite
- // a single column grid layout. For the widgets we add, we want a
- // a two-column grid, so we just create a sub composite for that.
- GridLayout gridLayout = new GridLayout();
- parent.setLayout( gridLayout );
- GridData gridData = new GridData( GridData.FILL_BOTH );
- parent.setLayoutData( gridData );
- Composite composite = new Composite( parent, SWT.None );
- gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
- composite.setLayout( gridLayout );
- parent = composite;
-
- // Create the controls
- createExpressionControl( parent );
- boolean hasDebugContext = DebugUITools.getDebugContext() != null;
- boolean hasMemorySpaces = hasDebugContext && fMemManagement != null && fMemManagement.getMemorySpaces() != null && fMemManagement.getMemorySpaces().length > 0;
- fHasMemorySpaceControls = !hasDebugContext || hasMemorySpaces;
- if ( fHasMemorySpaceControls ) {
- createMemorySpaceControl( parent, hasMemorySpaces );
- }
- createCountField( parent );
- createAccessWidgets( parent );
-
- // Initialize the inter-control state
- if ( fExpression != null && fExpression.length() > 0 ) {
- fExpressionInput.add( fExpression, 0 );
- fExpressionInput.select( 0 );
- }
- fExpressionInput.setFocus();
- if ( fHasMemorySpaceControls ) {
- fMemorySpaceInput.setEnabled( fMemorySpaceEnableButton.getEnabled() );
- }
- fRangeField.setEnabled( fRangeEnableButton.getEnabled() );
- updateUI();
- return parent;
- }
-
- private void createExpressionControl(Composite parent ) {
-
- Label l = new Label( parent, GridData.FILL_HORIZONTAL );
- l.setText( ActionMessages.getString( "AddWatchpointDialog.1" ) ); //$NON-NLS-1$
- GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
- gridData.horizontalSpan = 2;
- l.setLayoutData( gridData );
-
- fExpressionInput = new Combo( parent, SWT.BORDER );
- gridData = new GridData( GridData.FILL_HORIZONTAL );
- gridData.horizontalSpan = 2;
- fExpressionInput.setLayoutData( gridData );
- fExpressionInput.addModifyListener( this );
- for (String expression : sExpressionHistory) {
- fExpressionInput.add( expression );
- }
- }
-
- private void createMemorySpaceControl( Composite parent, boolean hasMemorySpaces ) {
- fMemorySpaceEnableButton = new Button( parent, SWT.CHECK );
- GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
- gridData.horizontalSpan = 1;
- fMemorySpaceEnableButton.setLayoutData( gridData );
- fMemorySpaceEnableButton.setText( ActionMessages.getString( "AddWatchpointDialog.5" ) ); //$NON-NLS-1$
- fMemorySpaceEnableButton.setSelection( false );
- fMemorySpaceEnableButton.addSelectionListener( this );
-
- if ( hasMemorySpaces ) {
- fMemorySpaceInput = new Combo( parent, SWT.BORDER | SWT.READ_ONLY );
- } else {
- fMemorySpaceInput = new Combo( parent, SWT.BORDER );
- }
- gridData = new GridData( GridData.FILL_HORIZONTAL );
- gridData.horizontalSpan = 1;
- fMemorySpaceInput.setLayoutData( gridData );
- fMemorySpaceInput.addSelectionListener( this );
- if ( fMemManagement != null ) {
- String [] memorySpaces = fMemManagement.getMemorySpaces();
- for ( int i = 0; i < memorySpaces.length; i++ ) {
- fMemorySpaceInput.add( memorySpaces[i] );
- }
- }
- if ( fMemorySpace != null && fMemorySpace.length() > 0 ) {
- int i = fMemorySpaceInput.indexOf( fMemorySpace );
- if ( i >= 0 ) {
- fMemorySpaceInput.select( i );
- fMemorySpaceEnableButton.setSelection( true );
- } else {
- fMemorySpaceInput.add( fMemorySpace );
- }
- }
- fMemorySpaceInput.addModifyListener( this );
- //234909 - for accessibility
- fMemorySpaceInput.getAccessible().addAccessibleListener(
- new AccessibleAdapter() {
- @Override
- public void getName(AccessibleEvent e) {
- e.result = ActionMessages.getString( "AddWatchpointDialog.5" ); //$NON-NLS-1$
- }
-
- });
- }
-
- /**
- * @param text
- * @param c
- * @return true if the concatenation of text + c results
- * in a valid string representation of an integer
- * @see verifyIntegerText()
- */
- private static boolean verifyIntegerTextAddition( String text, char c ) {
-
- // pass through all control characters
- if ( Character.isISOControl( c ) ) {
- return true;
- }
-
- // case-insensitive
- c = Character.toLowerCase( c );
- text = text.toLowerCase();
-
- // first character has to be 0-9
- if ( text.length() == 0 ) {
- return Character.isDigit( c );
- }
-
- // second character must be x if preceded by a 0, otherwise 0-9 will do
- if ( text.length() == 1 ) {
- if ( text.equals( "0" ) ) { //$NON-NLS-1$
- return c == 'x';
- }
- return Character.isDigit( c );
- }
-
- // all subsequent characters must be 0-9 or a-f if started with 0x
- return Character.isDigit( c )
- || text.startsWith( "0x" ) && 'a' <= c && c <= 'f'; //$NON-NLS-1$
- }
-
- /**
- * @param text integer string built up using verifyIntegerTextAddition()
- * @return true if text represents a valid string representation of
- * an integer
- */
- private static boolean verifyIntegerText( String text ) {
- if ( text.length() == 0 ) {
- return false;
- }
- if ( text.length() == 1 ) {
- return true;
- }
- if ( text.length() == 2 ) {
- return !text.equals("0x"); //$NON-NLS-1$
- }
- return true;
- }
-
- private void createCountField( Composite parent ) {
- fRangeEnableButton = new Button( parent, SWT.CHECK );
- GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
- gridData.horizontalSpan = 1;
- fRangeEnableButton.setLayoutData( gridData );
- fRangeEnableButton.setText( ActionMessages.getString( "AddWatchpointDialog.6" ) ); //$NON-NLS-1$
- fRangeEnableButton.setSelection( fRangeInitialEnable && fRange.length() > 0 );
- fRangeEnableButton.addSelectionListener( this );
-
- fRangeField = new Text( parent, SWT.BORDER );
- gridData = new GridData( GridData.FILL_HORIZONTAL );
- gridData.horizontalSpan = 1;
- GC gc = new GC( fRangeField );
- FontMetrics fm = gc.getFontMetrics();
- gridData.minimumWidth = 8 * fm.getAverageCharWidth();
- fRangeField.setLayoutData( gridData );
- fRangeField.setText( fRange );
- fRangeField.addVerifyListener( new VerifyListener() {
- @Override
- public void verifyText( VerifyEvent e ) {
- e.doit = verifyIntegerTextAddition( fRangeField.getText(), e.character );
- }
- });
- fRangeField.addModifyListener( this );
- //234909 - for accessibility
- fRangeField.getAccessible().addAccessibleListener(
- new AccessibleAdapter() {
- @Override
- public void getName(AccessibleEvent e) {
- e.result = ActionMessages.getString( "AddWatchpointDialog.6" ); //$NON-NLS-1$
- }
-
- });
- }
-
- private void createAccessWidgets( Composite parent ) {
- GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
- gridData.horizontalSpan = 3;
-
- Group group = new Group( parent, SWT.NONE );
- group.setLayout( new GridLayout() );
- group.setLayoutData( gridData );
- group.setText( ActionMessages.getString( "AddWatchpointDialog.2" ) ); //$NON-NLS-1$
- fChkBtnWrite = new Button( group, SWT.CHECK );
- fChkBtnWrite.setText( ActionMessages.getString( "AddWatchpointDialog.3" ) ); //$NON-NLS-1$
- fChkBtnWrite.setSelection( true );
- fChkBtnWrite.addSelectionListener( this );
- fChkBtnRead = new Button( group, SWT.CHECK );
- fChkBtnRead.setText( ActionMessages.getString( "AddWatchpointDialog.4" ) ); //$NON-NLS-1$
- fChkBtnRead.setSelection( false );
- fChkBtnRead.addSelectionListener( this );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- @Override
- protected void configureShell( Shell newShell ) {
- super.configureShell( newShell );
-
- // use the same title used by the platform dialog
- newShell.setText( ActionMessages.getString( "AddWatchpointDialog.0" ) ); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- @Override
- protected void okPressed() {
- fExpression = fExpressionInput.getText().trim();
- if ( fExpression.length() > 0 ) {
- addHistory( fExpression );
- }
- if ( fHasMemorySpaceControls ) {
- fMemorySpace = fMemorySpaceEnableButton.getSelection() ? fMemorySpaceInput.getText().trim() : ""; //$NON-NLS-1$
- }
- fRange = fRangeEnableButton.getSelection() ? fRangeField.getText().trim() : "0"; //$NON-NLS-1$
- fRead = fChkBtnRead.getSelection();
- fWrite = fChkBtnWrite.getSelection();
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText( ModifyEvent e ) {
- updateUI();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createButtonBar( Composite parent ) {
- return super.createButtonBar( parent );
- }
-
- public String getExpression() {
- return fExpression;
- }
-
- public String getMemorySpace() {
- return fMemorySpace;
- }
-
- private static void addHistory( String item ) {
- if ( !sExpressionHistory.contains( item ) ) {
- sExpressionHistory.add( 0, item );
-
- if ( sExpressionHistory.size() > 5 )
- sExpressionHistory.remove( sExpressionHistory.size() - 1 );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetDefaultSelected( SelectionEvent e ) {
- // ignore
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected( SelectionEvent e ) {
- updateUI();
- }
-
- private void updateUI() {
- if ( fHasMemorySpaceControls ) {
- fMemorySpaceInput.setEnabled( fMemorySpaceEnableButton.getSelection() );
- }
- fRangeField.setEnabled( fRangeEnableButton.getSelection() );
- Button b = getButton( IDialogConstants.OK_ID );
- if ( b == null ) {
- return;
- }
- b.setEnabled( okayEnabled() );
- }
-
- private boolean okayEnabled() {
- if ( !fChkBtnRead.getSelection() && !fChkBtnWrite.getSelection() ) {
- return false ;
- }
- if ( fExpressionInput.getText().length() == 0 ) {
- return false;
- }
- if ( fHasMemorySpaceControls && fMemorySpaceInput.getEnabled() && fMemorySpaceInput.getText().length() == 0 ) {
- return false;
- }
- if ( fRangeField.getEnabled()
- && ( fRangeField.getText().length() == 0 || !verifyIntegerText( fRangeField.getText() ) ) ) {
- return false;
- }
- return true;
- }
-
- public boolean getWriteAccess() {
- return fWrite;
- }
-
- public boolean getReadAccess() {
- return fRead;
- }
-
- public void setExpression(String expressionString ) {
- fExpression = expressionString;
- }
-
- public BigInteger getRange() {
- return BigInteger.valueOf( Long.decode(fRange).longValue() );
- }
-
- public void initializeRange( boolean enable, String range ) {
- fRangeInitialEnable = enable;
- fRange = range;
- }
-
- public void initializeMemorySpace( String memorySpace ) {
- fMemorySpace = memorySpace;
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- // override so we can change the initial okay enabled state
- createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
- true ).setEnabled( okayEnabled() );
- createButton( parent, IDialogConstants.CANCEL_ID,
- IDialogConstants.CANCEL_LABEL, false );
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BinaryVariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BinaryVariableFormatActionDelegate.java
deleted file mode 100644
index a48a9a3d92..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/BinaryVariableFormatActionDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software 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:
- * Mark Mitchell, CodeSourcery - Bug 136896: View variables in binary format
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import org.eclipse.cdt.debug.core.model.CVariableFormat;
-
-/**
- * The delegate of the "Binary Format" action.
- */
-public class BinaryVariableFormatActionDelegate extends VariableFormatActionDelegate {
-
- /**
- * Constructor for BinaryVariableFormatActionDelegate.
- */
- public BinaryVariableFormatActionDelegate() {
- super( CVariableFormat.BINARY );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CanFormatObjectTester.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CanFormatObjectTester.java
deleted file mode 100644
index 8b1ff2d84e..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CanFormatObjectTester.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import org.eclipse.cdt.debug.core.model.ICValue;
-import org.eclipse.cdt.debug.core.model.ICVariable;
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.debug.core.model.IWatchExpression;
-
-/**
- * Property test for object in selection.
- * property: canFormatObject - if object is C/C++ formattable
- * @author elaskavaia
- *
- */
-public class CanFormatObjectTester extends PropertyTester {
-
- public CanFormatObjectTester() {
-
- }
-
- @Override
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (property.equals("canFormatObject")) { //$NON-NLS-1$
- if (receiver instanceof ICVariable) { return expectedValue == Boolean.TRUE; }
- if (receiver instanceof IWatchExpression) {
- IWatchExpression w = (IWatchExpression) receiver;
- if (w.getValue() instanceof ICValue)
- return expectedValue == Boolean.TRUE;
- }
- return expectedValue == Boolean.FALSE;
- }
- return false;
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java
deleted file mode 100644
index 613549cc45..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DecVariableFormatActionDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import org.eclipse.cdt.debug.core.model.CVariableFormat;
-
-/**
- * The delegate of the "Decimal Format" action.
- */
-public class DecVariableFormatActionDelegate extends VariableFormatActionDelegate {
-
- /**
- * Constructor for DecVariableFormatActionDelegate.
- */
- public DecVariableFormatActionDelegate() {
- super( CVariableFormat.DECIMAL );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java
deleted file mode 100644
index 5ec27b263c..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/DisableVariablesActionDelegate.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-/**
- * Enter type comment.
- *
- * @since Jun 19, 2003
- */
-public class DisableVariablesActionDelegate extends EnableVariablesActionDelegate
-{
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.EnableVariablesActionDelegate#isEnableAction()
- */
- @Override
- protected boolean isEnableAction()
- {
- return false;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java
deleted file mode 100644
index bca7a42f68..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/EnableVariablesActionDelegate.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import java.util.Iterator;
-import org.eclipse.cdt.debug.core.model.IEnableDisableTarget;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * The delegate of the "Enable" action contribution to the "IVariable" objects.
- */
-public class EnableVariablesActionDelegate implements IViewActionDelegate {
-
- private IViewPart fView;
-
- private IAction fAction;
-
- public EnableVariablesActionDelegate() {
- }
-
- protected IViewPart getView() {
- return fView;
- }
-
- protected void setView( IViewPart view ) {
- fView = view;
- }
-
- protected IAction getAction() {
- return fAction;
- }
-
- protected void setAction( IAction action ) {
- fAction = action;
- }
-
- /**
- * This action enables variables.
- */
- protected boolean isEnableAction() {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- @Override
- public void init( IViewPart view ) {
- setView( view );
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- @Override
- public void run( IAction action ) {
- IStructuredSelection selection = getSelection();
- final int size = selection.size();
- if ( size == 0 )
- return;
- final Iterator it = selection.iterator();
- final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.getString( "EnableVariablesActionDelegate.0" ), null ); //$NON-NLS-1$
- BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
-
- @Override
- public void run() {
- while( it.hasNext() ) {
- IEnableDisableTarget target = getEnableDisableTarget( it.next() );
- if ( target != null && target.canEnableDisable() ) {
- try {
- if ( size > 1 ) {
- target.setEnabled( isEnableAction() );
- }
- else
- target.setEnabled( !target.isEnabled() );
- }
- catch( DebugException e ) {
- ms.merge( e.getStatus() );
- }
- }
- }
- update();
- }
- } );
- if ( !ms.isOK() ) {
- CDebugUIPlugin.errorDialog( ActionMessages.getString( "EnableVariablesActionDelegate.1" ), ms ); //$NON-NLS-1$
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void selectionChanged( IAction action, ISelection selection ) {
- setAction( action );
- if ( !(selection instanceof IStructuredSelection) )
- return;
- IStructuredSelection sel = (IStructuredSelection)selection;
- Object o = sel.getFirstElement();
- if ( getEnableDisableTarget( o ) == null )
- return;
- Iterator it = sel.iterator();
- boolean allEnabled = true;
- boolean allDisabled = true;
- while( it.hasNext() ) {
- IEnableDisableTarget target = getEnableDisableTarget( it.next() );
- if ( target != null && target.canEnableDisable() ) {
- if ( target.isEnabled() )
- allDisabled = false;
- else
- allEnabled = false;
- }
- }
- if ( isEnableAction() )
- action.setEnabled( !allEnabled );
- else
- action.setEnabled( !allDisabled );
- }
-
- private IStructuredSelection getSelection() {
- return (IStructuredSelection)getView().getViewSite().getSelectionProvider().getSelection();
- }
-
- protected void update() {
- getView().getViewSite().getSelectionProvider().setSelection( getView().getViewSite().getSelectionProvider().getSelection() );
- }
-
- protected IEnableDisableTarget getEnableDisableTarget( Object obj ) {
- IEnableDisableTarget target = null;
- if ( obj instanceof IAdaptable ) {
- target = ((IAdaptable)obj).getAdapter( IEnableDisableTarget.class );
- }
- return target;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java
deleted file mode 100644
index 3268250b38..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/HexVariableFormatActionDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import org.eclipse.cdt.debug.core.model.CVariableFormat;
-
-/**
- * The delegate of the "Hexadecimal Format" action.
- */
-public class HexVariableFormatActionDelegate extends VariableFormatActionDelegate {
-
- /**
- * Constructor for HexVariableFormatActionDelegate.
- */
- public HexVariableFormatActionDelegate() {
- super( CVariableFormat.HEXADECIMAL );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllActionDelegate.java
deleted file mode 100644
index a1f45d2e6e..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadSymbolsForAllActionDelegate.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import org.eclipse.cdt.debug.core.CDIDebugModel;
-import org.eclipse.cdt.debug.core.CDebugUtils;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
-import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.jface.action.IAction;
-
-/**
- * The delegate for the "Load Symbols For All" action of the Modules view.
- */
-public class LoadSymbolsForAllActionDelegate extends AbstractViewActionDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractViewActionDelegate#getErrorDialogTitle()
- */
- @Override
- protected String getErrorDialogTitle() {
- return ActionMessages.getString( "LoadSymbolsForAllActionDelegate.Error_1" ); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractViewActionDelegate#getErrorDialogMessage()
- */
- @Override
- protected String getErrorDialogMessage() {
- return ActionMessages.getString( "LoadSymbolsForAllActionDelegate.Error(s)_occurred_loading_the_symbols_1" ); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractViewActionDelegate#doAction()
- */
- @Override
- protected void doAction() throws DebugException {
- ICDebugTarget target = getDebugTarget( getView().getViewer().getInput() );
- if ( target != null ) {
- final IModuleRetrieval mr = target.getAdapter( IModuleRetrieval.class );
- if ( mr != null ) {
- DebugPlugin.getDefault().asyncExec(
- new Runnable() {
-
- @Override
- public void run() {
- try {
- mr.loadSymbolsForAllModules();
- }
- catch( DebugException e ) {
- failed( e );
- }
- }
- } );
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractViewActionDelegate#update()
- */
- @Override
- protected void update() {
- IAction action = getAction();
- if ( getView() != null && getView().getViewer() != null && action != null ) {
- ICDebugTarget target = getDebugTarget( getView().getViewer().getInput() );
- action.setEnabled( ( target != null ) ? target.isSuspended() : false );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.AbstractViewActionDelegate#doHandleDebugEvent(org.eclipse.debug.core.DebugEvent)
- */
- @Override
- protected void doHandleDebugEvent( DebugEvent event ) {
- }
-
- private ICDebugTarget getDebugTarget( Object element ) {
- if ( element instanceof IAdaptable ) {
- return ((IAdaptable)element).getAdapter( ICDebugTarget.class );
- }
- return null;
- }
-
- protected void failed( Throwable e ) {
- MultiStatus ms = new MultiStatus( CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, ActionMessages.getString( "LoadSymbolsForAllActionDelegate.0" ), null ); //$NON-NLS-1$
- ms.add( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, e.getMessage(), e ) );
- CDebugUtils.error( ms, this );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java
index 39f2912509..1d4d6f6330 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java
@@ -15,8 +15,6 @@ import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.model.IMoveToLine;
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
-import org.eclipse.cdt.debug.internal.core.model.CDebugElement;
-import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector;
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
@@ -29,8 +27,6 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.model.ISuspendResume;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextSelection;
@@ -64,15 +60,10 @@ public class MoveToLineAdapter implements IMoveToLineTarget {
}
else {
final String fileName = getFileName( input );
- IDebugTarget debugTarget = null;
- if (target instanceof CDebugElement) {
- debugTarget = ((CDebugElement)target).getDebugTarget();
- }
-
ITextSelection textSelection = (ITextSelection)selection;
final int lineNumber = textSelection.getStartLine() + 1;
if ( target instanceof IAdaptable ) {
- final IPath path = convertPath( fileName, debugTarget );
+ final IPath path = new Path( fileName );
final IMoveToLine moveToLine = ((IAdaptable)target).getAdapter( IMoveToLine.class );
if ( moveToLine != null && moveToLine.canMoveToLine( path.toPortableString(), lineNumber ) ) {
Runnable r = new Runnable() {
@@ -131,13 +122,7 @@ public class MoveToLineAdapter implements IMoveToLineTarget {
if (fileName == null) {
return false;
}
-
- IDebugTarget debugTarget = null;
- if (target instanceof CDebugElement) {
- debugTarget = ((CDebugElement)target).getDebugTarget();
- }
-
- final IPath path = convertPath( fileName, debugTarget );
+ final IPath path = new Path( fileName );
ITextSelection textSelection = (ITextSelection)selection;
int lineNumber = textSelection.getStartLine() + 1;
return moveToLine.canMoveToLine(path.toPortableString(), lineNumber );
@@ -159,19 +144,4 @@ public class MoveToLineAdapter implements IMoveToLineTarget {
ms.add( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, e.getMessage(), e ) );
CDebugUtils.error( ms, this );
}
- private IPath convertPath( String sourceHandle, IDebugTarget debugTarget ) {
- IPath path = null;
- if ( Path.EMPTY.isValidPath( sourceHandle ) ) {
- if ( debugTarget != null ) {
- ISourceLocator sl = debugTarget.getLaunch().getSourceLocator();
- if ( sl instanceof CSourceLookupDirector ) {
- path = ((CSourceLookupDirector)sl).getCompilationPath( sourceHandle );
- }
- }
- if ( path == null ) {
- path = new Path( sourceHandle );
- }
- }
- return path;
- }
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java
deleted file mode 100644
index f7ec7f1548..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NaturalVariableFormatActionDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import org.eclipse.cdt.debug.core.model.CVariableFormat;
-
-/**
- * The delegate of the "Natural Format" action.
- */
-public class NaturalVariableFormatActionDelegate extends VariableFormatActionDelegate {
-
- /**
- * Constructor for NaturalVariableFormatActionDelegate.
- */
- public NaturalVariableFormatActionDelegate() {
- super( CVariableFormat.NATURAL );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NumberFormatsContribution.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NumberFormatsContribution.java
deleted file mode 100644
index 818a24e7d3..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/NumberFormatsContribution.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- * Marc Khouzam (Ericsson) - Support for octal number format (bug 370462)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.cdt.debug.core.model.CVariableFormat;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.menus.IWorkbenchContribution;
-import org.eclipse.ui.services.IServiceLocator;
-
-/**
- * Dynamic menu contribution that shows available number formats
- * in the current view.
- *
- * @since 6.0
- */
-public class NumberFormatsContribution extends CompoundContributionItem implements IWorkbenchContribution {
- static final String CURRENT_FORMAT = "current_format";
-
- private static final Map<CVariableFormat, String> FORMATS = new LinkedHashMap<CVariableFormat, String>();
- static {
- FORMATS.put(CVariableFormat.NATURAL, "Default");
- FORMATS.put(CVariableFormat.DECIMAL, "Decimal");
- FORMATS.put(CVariableFormat.HEXADECIMAL, "Hexadecimal");
- FORMATS.put(CVariableFormat.OCTAL, "Octal");
- FORMATS.put(CVariableFormat.BINARY, "Binary");
- }
-
- private class SelectNumberFormatAction extends Action {
- private final CVariableFormat fFormat;
- private VariableFormatActionDelegate delegate;
-
- public VariableFormatActionDelegate getDelegate() {
- return delegate;
- }
-
- SelectNumberFormatAction(CVariableFormat format) {
- super(FORMATS.get(format), AS_RADIO_BUTTON);
-
- fFormat = format;
- delegate = new VariableFormatActionDelegate(fFormat);
- }
-
- void selectionChanged(ISelection sel) {
- delegate.selectionChanged(this, sel);
- }
-
- @Override
- public void run() {
- if (isChecked()) {
- delegate.run(this);
- }
- }
- }
-
- private IServiceLocator fServiceLocator;
-
- private static IContributionItem[] NO_ITEMS = new IContributionItem[] { new ContributionItem() {
- @Override
- public void fill(Menu menu, int index) {
- MenuItem item = new MenuItem(menu, SWT.NONE);
- item.setEnabled(false);
- item.setText("Empty");
- }
-
- @Override
- public boolean isEnabled() {
- return false;
- }
- } };
-
- @Override
- protected IContributionItem[] getContributionItems() {
- ISelectionService service = fServiceLocator.getService(ISelectionService.class);
- ISelection selection = service.getSelection();
-
-
- List<Action> actions = new ArrayList<Action>(FORMATS.size());
-
- for (CVariableFormat formatId : FORMATS.keySet()) {
- SelectNumberFormatAction action = new SelectNumberFormatAction(formatId);
- action.selectionChanged(selection);
- actions.add(action);
- }
-
- if (actions.isEmpty()) { return NO_ITEMS; }
-
- IContributionItem[] items = new IContributionItem[actions.size()];
- for (int i = 0; i < actions.size(); i++) {
- items[i] = new ActionContributionItem(actions.get(i));
- }
- return items;
- }
-
- @Override
- public void initialize(IServiceLocator serviceLocator) {
- fServiceLocator = serviceLocator;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RemoveAllGlobalsActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RemoveAllGlobalsActionDelegate.java
deleted file mode 100644
index fc947dfb7c..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RemoveAllGlobalsActionDelegate.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import org.eclipse.cdt.debug.core.ICGlobalVariableManager;
-import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-/**
- * A delegate for the "Remove All Globals" action.
- */
-public class RemoveAllGlobalsActionDelegate extends ActionDelegate implements IViewActionDelegate, IDebugEventSetListener {
-
- private IAction fAction;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- @Override
- public void init( IViewPart view ) {
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionDelegate#init(org.eclipse.jface.action.IAction)
- */
- @Override
- public void init( IAction action ) {
- DebugPlugin.getDefault().addDebugEventListener(this);
- fAction = action;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- update();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionDelegate#dispose()
- */
- @Override
- public void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- fAction = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- @Override
- public void run( IAction action ) {
- IAdaptable context = DebugUITools.getDebugContext();
- if ( context instanceof IDebugElement ) {
- final ICGlobalVariableManager gvm = ((IDebugElement)context).getDebugTarget().getAdapter( ICGlobalVariableManager.class );
- if ( gvm != null ) {
- DebugPlugin.getDefault().asyncExec(
- new Runnable() {
- @Override
- public void run() {
- gvm.removeAllGlobals();
- }
- } );
- }
- }
- }
-
- /**
- * Enables/disables the action based on whether there are any globals in the
- * variables view.
- */
- private void update() {
- final IAction action = fAction;
- if (action != null) {
- final IAdaptable context = DebugUITools.getDebugContext();
- boolean enabled = false;
- if (context instanceof IDebugElement) {
- final ICGlobalVariableManager gvm = ((IDebugElement) context)
- .getDebugTarget().getAdapter(
- ICGlobalVariableManager.class);
- if (gvm != null) {
- final IGlobalVariableDescriptor[] globals = gvm
- .getDescriptors();
- enabled = globals != null && globals.length > 0;
- }
- }
- action.setEnabled(enabled);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- @Override
- public void handleDebugEvents( DebugEvent[] events ) {
- // The ICGlobalVariableManager will fire a target content-changed
- // event when a global is added or removed. Update the enable/disable
- // state of this action accordingly
-
- if (fAction != null) {
- for (int i = 0; i < events.length; i++) {
- final DebugEvent event = events[i];
- if (event.getSource() instanceof IDebugTarget
- && event.getKind() == DebugEvent.CHANGE
- && event.getDetail() == DebugEvent.CONTENT ) {
- update();
- break;
- }
- }
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RemoveGlobalsActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RemoveGlobalsActionDelegate.java
deleted file mode 100644
index 8b9f1795f0..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RemoveGlobalsActionDelegate.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import org.eclipse.cdt.debug.core.ICGlobalVariableManager;
-import org.eclipse.cdt.debug.core.model.ICGlobalVariable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-/**
- * A delegate for the "Remove Globals" action.
- */
-public class RemoveGlobalsActionDelegate extends ActionDelegate implements IViewActionDelegate {
-
- private IAction fAction;
-
- private ISelection fSelection;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- @Override
- public void init( IViewPart view ) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- @Override
- public void init( IAction action ) {
- setAction( action );
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- @Override
- public void run( IAction action ) {
- ISelection selection = getSelection();
- if ( !(selection instanceof IStructuredSelection) )
- return;
- IStructuredSelection ss = (IStructuredSelection)selection;
- final Iterator it = ss.iterator();
- ArrayList list = new ArrayList( ss.size() );
- while( it.hasNext() ) {
- Object obj = it.next();
- if ( obj instanceof ICGlobalVariable )
- list.add( obj );
- }
- if ( list.size() == 0 )
- return;
- final ICGlobalVariable[] globals = (ICGlobalVariable[])list.toArray( new ICGlobalVariable[list.size()] );
- final ICGlobalVariableManager gvm = globals[0].getDebugTarget().getAdapter( ICGlobalVariableManager.class );
- if ( gvm == null )
- return;
- Runnable r = new Runnable() {
- @Override
- public void run() {
- gvm.removeGlobals( globals );
- }
- };
- DebugPlugin.getDefault().asyncExec( r );
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void selectionChanged( IAction action, ISelection selection ) {
- setSelection( selection );
- update();
- }
-
- protected IAction getAction() {
- return fAction;
- }
-
- protected ISelection getSelection() {
- return fSelection;
- }
-
- private void setAction( IAction action ) {
- fAction = action;
- }
-
- private void setSelection( ISelection selection ) {
- fSelection = selection;
- }
-
- private void update() {
- IAction action = getAction();
- if ( action != null ) {
- ISelection selection = getSelection();
- boolean enabled = false;
- if ( selection instanceof IStructuredSelection ) {
- Iterator it = ((IStructuredSelection)selection).iterator();
- while( it.hasNext() ) {
- if ( it.next() instanceof ICGlobalVariable ) {
- enabled = true;
- break;
- }
- }
- }
- action.setEnabled( enabled );
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
index 42aa56e3cf..ddd6f68648 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
@@ -15,8 +15,6 @@ import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.model.IResumeAtLine;
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
-import org.eclipse.cdt.debug.internal.core.model.CDebugElement;
-import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector;
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
@@ -29,8 +27,6 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.model.ISuspendResume;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextSelection;
@@ -64,11 +60,7 @@ public class ResumeAtLineAdapter implements IResumeAtLineTarget {
}
else {
final String fileName = getFileName( input ); // actually, absolute path, not just file name
- IDebugTarget debugTarget = null;
- if ( target instanceof CDebugElement ) {
- debugTarget = ((CDebugElement)target).getDebugTarget();
- }
- final IPath path = convertPath( fileName, debugTarget );
+ final IPath path = new Path(fileName);
ITextSelection textSelection = (ITextSelection)selection;
final int lineNumber = textSelection.getStartLine() + 1;
if ( target instanceof IAdaptable ) {
@@ -130,12 +122,8 @@ public class ResumeAtLineAdapter implements IResumeAtLineTarget {
if (fileName == null) {
return false;
}
- IDebugTarget debugTarget = null;
- if ( target instanceof CDebugElement ) {
- debugTarget = ((CDebugElement)target).getDebugTarget();
- }
- final IPath path = convertPath( fileName, debugTarget );
+ final IPath path = new Path( fileName );
ITextSelection textSelection = (ITextSelection)selection;
int lineNumber = textSelection.getStartLine() + 1;
return resumeAtLine.canResumeAtLine( path.toPortableString(), lineNumber );
@@ -157,20 +145,4 @@ public class ResumeAtLineAdapter implements IResumeAtLineTarget {
ms.add( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, e.getMessage(), e ) );
CDebugUtils.error( ms, this );
}
-
- private IPath convertPath( String sourceHandle, IDebugTarget debugTarget ) {
- IPath path = null;
- if ( Path.EMPTY.isValidPath( sourceHandle ) ) {
- if ( debugTarget != null ) {
- ISourceLocator sl = debugTarget.getLaunch().getSourceLocator();
- if ( sl instanceof CSourceLookupDirector ) {
- path = ((CSourceLookupDirector)sl).getCompilationPath( sourceHandle );
- }
- }
- if ( path == null ) {
- path = new Path( sourceHandle );
- }
- }
- return path;
- }
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
index 9f287b3171..a5e77c0cf0 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
@@ -15,8 +15,6 @@ import org.eclipse.cdt.debug.core.CDIDebugModel;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.model.IRunToLine;
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
-import org.eclipse.cdt.debug.internal.core.model.CDebugElement;
-import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector;
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
@@ -29,8 +27,6 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.model.ISuspendResume;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
@@ -67,11 +63,7 @@ public class RunToLineAdapter implements IRunToLineTarget {
}
else {
final String fileName = getFileName( input ); // actually, absolute path, not just file name
- IDebugTarget debugTarget = null;
- if (target instanceof CDebugElement) { // should always be, but just in case
- debugTarget = ((CDebugElement)target).getDebugTarget();
- }
- final IPath path = convertPath( fileName, debugTarget );
+ final IPath path = new Path( fileName );
ITextSelection textSelection = (ITextSelection)selection;
final int lineNumber = textSelection.getStartLine() + 1;
if ( target instanceof IAdaptable ) {
@@ -134,11 +126,7 @@ public class RunToLineAdapter implements IRunToLineTarget {
if (fileName == null) {
return false;
}
- IDebugTarget debugTarget = null;
- if (target instanceof CDebugElement) { // should always be, but just in case
- debugTarget = ((CDebugElement)target).getDebugTarget();
- }
- final IPath path = convertPath( fileName, debugTarget );
+ final IPath path = new Path( fileName );
ITextSelection textSelection = (ITextSelection)selection;
int lineNumber = textSelection.getStartLine() + 1;
@@ -161,20 +149,4 @@ public class RunToLineAdapter implements IRunToLineTarget {
ms.add( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), ICDebugInternalConstants.STATUS_CODE_ERROR, e.getMessage(), e ) );
CDebugUtils.error( ms, this );
}
-
- private IPath convertPath( String sourceHandle, IDebugTarget debugTarget ) {
- IPath path = null;
- if ( Path.EMPTY.isValidPath( sourceHandle ) ) {
- if ( debugTarget != null ) {
- ISourceLocator sl = debugTarget.getLaunch().getSourceLocator();
- if ( sl instanceof CSourceLookupDirector ) {
- path = ((CSourceLookupDirector)sl).getCompilationPath( sourceHandle );
- }
- }
- if ( path == null ) {
- path = new Path( sourceHandle );
- }
- }
- return path;
- }
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java
index be1a2350e8..16411c980a 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleInstructionStepModeActionDelegate.java
@@ -11,11 +11,8 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.actions;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
import org.eclipse.cdt.debug.core.model.ISteppingModeTarget;
import org.eclipse.cdt.debug.core.model.ITargetProperties;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
@@ -32,10 +29,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.ActionDelegate;
/**
@@ -114,17 +109,6 @@ public class ToggleInstructionStepModeActionDelegate extends ActionDelegate
ISteppingModeTarget target = getTarget();
if ( target != null ) {
target.enableInstructionStepping( enabled );
- if ( enabled && target instanceof ICDebugTarget ) {
- try {
- IWorkbenchPage page = fWindow.getActivePage();
- if (page != null) {
- page.showView( ICDebugUIConstants.ID_DSF_DISASSEMBLY_VIEW );
- }
- }
- catch( PartInitException e ) {
- CDebugUIPlugin.log( e.getStatus() );
- }
- }
}
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java
deleted file mode 100644
index 857a946fda..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/VariableFormatActionDelegate.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2012 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.cdt.debug.core.model.CVariableFormat;
-import org.eclipse.cdt.debug.core.model.ICVariable;
-import org.eclipse.cdt.debug.internal.core.model.AbstractCValue;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.core.WatchExpression;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * The superclass of the all format action delegates.
- */
-public class VariableFormatActionDelegate implements IObjectActionDelegate {
- private CVariableFormat fFormat = CVariableFormat.NATURAL;
- private ICVariable[] fVariables = null;
- private IStructuredSelection selection;
-
- /**
- * Constructor for VariableFormatActionDelegate.
- */
- public VariableFormatActionDelegate(CVariableFormat format) {
- fFormat = format;
- }
-
- /**
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- @Override
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(IAction)
- */
- @Override
- public void run(IAction action) {
- ICVariable[] vars = getVariables();
- if (vars != null && vars.length > 0) {
- final MultiStatus ms = new MultiStatus(CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, "", null); //$NON-NLS-1$
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- @Override
- public void run() {
- try {
- doAction(getVariables());
- } catch (DebugException e) {
- ms.merge(e.getStatus());
- }
- }
- });
- if (!ms.isOK()) {
- IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- CDebugUIPlugin.errorDialog(ActionMessages.getString("VariableFormatActionDelegate.0"), ms); //$NON-NLS-1$
- } else {
- CDebugUIPlugin.log(ms);
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
- */
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
-
- if (selection instanceof IStructuredSelection) {
- this.selection = (IStructuredSelection) selection;
- List<ICVariable> list = new ArrayList<ICVariable>();
- IStructuredSelection ssel = (IStructuredSelection) selection;
- Iterator i = ssel.iterator();
- while (i.hasNext()) {
- Object o = i.next();
- if (o instanceof ICVariable) {
- ICVariable var = (ICVariable) o;
- list.add(var);
- } else if (o instanceof IWatchExpression) {
- IWatchExpression expr = (IWatchExpression) o;
- IValue value = expr.getValue();
- if (value instanceof AbstractCValue) {
- ICVariable parent = ((AbstractCValue) value).getParentVariable();
- if (parent != null) {
- list.add(parent);
- }
- }
- }
- }
- for (Iterator<ICVariable> iterator = list.iterator(); iterator.hasNext();) {
- ICVariable var = iterator.next();
- boolean enabled = var.supportsFormatting();
- action.setEnabled(enabled);
- if (enabled) {
- action.setChecked(var.getFormat() == fFormat);
- } else {
- iterator.remove();
- }
- }
- setVariables(list.toArray(new ICVariable[list.size()]));
- } else {
- action.setChecked(false);
- action.setEnabled(false);
- }
- }
-
-
- protected void doAction( ICVariable[] vars ) throws DebugException {
- for( int i = 0; i < vars.length; i++ ) {
- vars[i].changeFormat( fFormat );
- }
- for (Iterator iterator = selection.iterator(); iterator.hasNext();) {
- Object o = iterator.next();
- if (o instanceof WatchExpression){
- ((WatchExpression)o).evaluate();
- }
- }
- }
-
- protected ICVariable[] getVariables() {
- return fVariables;
- }
-
- private void setVariables(ICVariable[] variables) {
- fVariables = variables;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java
index 51f9aaa3c6..13ce246a0b 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/ToggleBreakpointAdapter.java
@@ -18,10 +18,7 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.debug.core.CDIDebugModel;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIMemorySpaceManagement;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.model.ICBreakpointType;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
@@ -29,8 +26,6 @@ import org.eclipse.cdt.debug.core.model.ICWatchpoint;
import org.eclipse.cdt.debug.ui.breakpoints.AbstractToggleBreakpointAdapter;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.ui.IWorkbenchPart;
/**
@@ -112,23 +107,4 @@ public class ToggleBreakpointAdapter extends AbstractToggleBreakpointAdapter {
protected int getBreakpointType() {
return ICBreakpointType.REGULAR;
}
-
- public static ICDIMemorySpaceManagement getMemorySpaceManagement(){
- IAdaptable debugViewElement = DebugUITools.getDebugContext();
- ICDIMemorySpaceManagement memMgr = null;
-
- if ( debugViewElement != null ) {
- ICDebugTarget debugTarget = debugViewElement.getAdapter(ICDebugTarget.class);
-
- if ( debugTarget != null ){
- ICDITarget target = debugTarget.getAdapter(ICDITarget.class);
-
- if (target instanceof ICDIMemorySpaceManagement)
- memMgr = (ICDIMemorySpaceManagement)target;
- }
- }
-
- return memMgr;
- }
-
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/BreakpointsMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/BreakpointsMessages.properties
index 8942d9a016..0605ed04b4 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/BreakpointsMessages.properties
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/BreakpointsMessages.properties
@@ -38,7 +38,6 @@ CBreakpointPropertyPage.watchpointType_write_label=Write
CBreakpointPropertyPage.watchpoint_expression_label=Expression to watch:
CBreakpointPropertyPage.watchpoint_expression_errorMessage=Enter the expression to watch:
CBreakpointPropertyPage.watchpoint_range_label=Range:
-CBreakpointPropertyPage.watchpoint_memorySpace_label=Memory Space:
CBreakpointPropertyPage.workspace_button=W&orkspace...
CBreakpointPropertyPage.condition_label=&Condition:
CBreakpointPropertyPage.condition_invalidValue_message=Invalid condition.
@@ -47,8 +46,6 @@ CBreakpointPropertyPage.breakpointType_label=Class:
CBreakpointPropertyPage.enabled_label=Enabled
CBreakpointPropertyPage.eventType_label=Event Type
-ThreadFilterEditor.0=&Restrict to Selected Targets and Threads:
-
TracepointPropertyPage.tracepointType_function_label=C/C++ Function Tracepoint
TracepointPropertyPage.tracepointType_address_label=C/C++ Address Tracepoint
TracepointPropertyPage.tracepointType_line_label=C/C++ Line Tracepoint
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointFilteringPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointFilteringPage.java
deleted file mode 100644
index 78a1023d9d..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointFilteringPage.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.breakpoints;
-
-import org.eclipse.cdt.debug.core.CDIDebugModel;
-import org.eclipse.cdt.debug.core.model.ICBreakpoint;
-import org.eclipse.cdt.debug.core.model.ICBreakpointFilterExtension;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-public class CBreakpointFilteringPage extends PropertyPage {
-
- private ThreadFilterEditor fThreadFilterEditor;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createContents( Composite parent ) {
- noDefaultAndApplyButton();
- Composite mainComposite = new Composite( parent, SWT.NONE );
- mainComposite.setFont( parent.getFont() );
- mainComposite.setLayout( new GridLayout() );
- mainComposite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
- createThreadFilterEditor( mainComposite );
- setValid( true );
- return mainComposite;
- }
-
- public ICBreakpoint getBreakpoint() {
- return getElement().getAdapter(ICBreakpoint.class);
- }
-
- public ICBreakpointFilterExtension getFilterExtension() {
- ICBreakpoint bp = getBreakpoint();
- if (bp != null) {
- try {
- return bp.getExtension(
- CDIDebugModel.getPluginIdentifier(), ICBreakpointFilterExtension.class);
- } catch (CoreException e) {}
- }
- return null;
- }
-
- protected void createThreadFilterEditor( Composite parent ) {
- fThreadFilterEditor = new ThreadFilterEditor( parent, this );
- }
-
- protected ThreadFilterEditor getThreadFilterEditor() {
- return fThreadFilterEditor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- @Override
- public boolean performOk() {
- doStore();
- return super.performOk();
- }
-
- /**
- * Stores the values configured in this page.
- */
- protected void doStore() {
- fThreadFilterEditor.doStore();
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java
index dcdf5d43ab..19b6e6b83f 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointPropertyPage.java
@@ -19,11 +19,8 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.debug.core.CDIDebugModel;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIMemorySpaceManagement;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
@@ -524,25 +521,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement
}
return array2d;
}
-
- private ICDIMemorySpaceManagement getMemorySpaceManagement(){
- Object debugViewElement = getDebugContext();
- ICDIMemorySpaceManagement memMgr = null;
-
- if ( debugViewElement != null ) {
- ICDebugTarget debugTarget = (ICDebugTarget)DebugPlugin.getAdapter(debugViewElement, ICDebugTarget.class);
-
- if ( debugTarget != null ){
- ICDITarget target = debugTarget.getAdapter(ICDITarget.class);
-
- if (target instanceof ICDIMemorySpaceManagement)
- memMgr = (ICDIMemorySpaceManagement)target;
- }
- }
-
- return memMgr;
- }
-
+
class LabelFieldEditor extends ReadOnlyFieldEditor {
private String fValue;
@@ -769,17 +748,9 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement
protected void createWatchMemorySpaceEditor( Composite parent ) {
ICBreakpoint breakpoint = getBreakpoint();
if (breakpoint == null || breakpoint.getMarker() == null) {
- ICDIMemorySpaceManagement memSpaceMgmt = getMemorySpaceManagement();
- if (memSpaceMgmt != null) {
- String[] memorySpaces = memSpaceMgmt.getMemorySpaces();
- if (memorySpaces != null && memorySpaces.length != 0) {
- addField( new WatchpointMemorySpaceFieldEditor(
- ICWatchpoint2.MEMORYSPACE,
- BreakpointsMessages.getString("CBreakpointPropertyPage.watchpoint_memorySpace_label"), //$NON-NLS-1$
- memorySpaces,
- parent) );
- }
- }
+ // XXX: In pre-CDI removal this set up additional field by getting memory space
+ // from ICDIMemorySpaceManagement. post-CDT removal memory space is still displayed
+ // (else below) but cannot be set on new breakpoints
} else {
String memorySpace = getPreferenceStore().getString(ICWatchpoint2.MEMORYSPACE);
if (memorySpace != null && memorySpace.length() != 0) {
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java
index 4f5f9b517d..425ffd72f1 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java
@@ -11,9 +11,9 @@
package org.eclipse.cdt.debug.internal.ui.breakpoints;
import java.util.Map;
+
import org.eclipse.cdt.debug.core.ICBreakpointListener;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
@@ -54,22 +54,6 @@ public class CBreakpointUpdater implements ICBreakpointListener {
*/
@Override
public void breakpointInstalled( final IDebugTarget target, IBreakpoint breakpoint ) {
- if ( breakpoint instanceof ICBreakpoint && target instanceof ICDebugTarget ) {
- final ICBreakpoint b = (ICBreakpoint)breakpoint;
- asyncExec( new Runnable() {
-
- @Override
- public void run() {
- try {
- if ( b.incrementInstallCount() == 1 )
- DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged( b );
- }
- catch( CoreException e ) {
- CDebugUIPlugin.log( e.getStatus() );
- }
- }
- } );
- }
}
/*
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ThreadFilterEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ThreadFilterEditor.java
deleted file mode 100644
index b327884552..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ThreadFilterEditor.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.breakpoints;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.cdt.debug.core.model.ICBreakpointFilterExtension;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICThread;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-public class ThreadFilterEditor {
-
- /**
- * Comment for ThreadFilterEditor.
- */
- public class CheckHandler implements ICheckStateListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
- */
- @Override
- public void checkStateChanged( CheckStateChangedEvent event ) {
- Object element = event.getElement();
- if ( element instanceof IDebugTarget ) {
- checkTarget( (IDebugTarget)element, event.getChecked() );
- }
- else if ( element instanceof IThread ) {
- checkThread( (IThread)element, event.getChecked() );
- }
- }
-
- /**
- * Check or uncheck a debug target in the tree viewer.
- * When a debug target is checked, attempt to
- * check all of the target's threads by default.
- * When a debug target is unchecked, uncheck all
- * its threads.
- */
- protected void checkTarget( IDebugTarget target, boolean checked ) {
- getThreadViewer().setChecked( target, checked );
- getThreadViewer().setGrayed( target, false );
- getThreadViewer().expandToLevel( target, AbstractTreeViewer.ALL_LEVELS );
- IThread[] threads;
- try {
- threads = target.getThreads();
- }
- catch( DebugException exception ) {
- CDebugUIPlugin.log( exception );
- return;
- }
- for( int i = 0; i < threads.length; i++ ) {
- getThreadViewer().setChecked( threads[i], checked );
- getThreadViewer().setGrayed( threads[i], false );
- }
- }
-
- /**
- * Check or uncheck a thread.
- * Update the thread's debug target.
- */
- protected void checkThread( IThread thread, boolean checked ) {
- getThreadViewer().setChecked( thread, checked );
- IDebugTarget target = (thread).getDebugTarget();
- IThread[] threads;
- try {
- threads = target.getThreads();
- }
- catch( DebugException exception ) {
- CDebugUIPlugin.log( exception );
- return;
- }
- int checkedNumber = 0;
- for( int i = 0; i < threads.length; i++ ) {
- if ( getThreadViewer().getChecked( threads[i] ) ) {
- ++checkedNumber;
- }
- }
- if ( checkedNumber == 0 ) {
- getThreadViewer().setChecked( target, false );
- getThreadViewer().setGrayed( target, false );
- }
- else if ( checkedNumber == threads.length ) {
- getThreadViewer().setChecked( target, true );
- getThreadViewer().setGrayed( target, false );
- }
- else {
- getThreadViewer().setGrayChecked( target, true );
- }
- }
- }
-
- /**
- * Comment for ThreadFilterEditor.
- */
- public class ThreadFilterContentProvider implements ITreeContentProvider {
-
- /**
- * Constructor for ThreadFilterContentProvider.
- */
- public ThreadFilterContentProvider() {
- super();
- // TODO Auto-generated constructor stub
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- @Override
- public Object[] getChildren( Object parent ) {
- if ( parent instanceof IDebugTarget ) {
- ICDebugTarget target = ((IDebugTarget)parent).getAdapter( ICDebugTarget.class );
- if ( target != null ) {
- try {
- return ((ICDebugTarget)parent).getThreads();
- }
- catch( DebugException e ) {
- CDebugUIPlugin.log( e );
- }
- }
- }
- if ( parent instanceof ILaunchManager ) {
- List<Object> children = new ArrayList<Object>();
- ILaunch[] launches = ((ILaunchManager)parent).getLaunches();
- IDebugTarget[] targets;
- ICDebugTarget target;
- for( int i = 0, numLaunches = launches.length; i < numLaunches; i++ ) {
- targets = launches[i].getDebugTargets();
- for( int j = 0, numTargets = targets.length; j < numTargets; j++ ) {
- target = targets[j].getAdapter( ICDebugTarget.class );
- if ( target != null && !target.isDisconnected() && !target.isTerminated() ) {
- children.add( target );
- }
- }
- }
- return children.toArray();
- }
- return new Object[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- @Override
- public Object getParent( Object element ) {
- if ( element instanceof IThread ) {
- return ((IThread)element).getDebugTarget();
- }
- if ( element instanceof IDebugTarget ) {
- return ((IDebugElement)element).getLaunch();
- }
- if ( element instanceof ILaunch ) {
- return DebugPlugin.getDefault().getLaunchManager();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- @Override
- public boolean hasChildren( Object element ) {
- if ( element instanceof IStackFrame ) {
- return false;
- }
- if ( element instanceof IDebugElement ) {
- return getChildren( element ).length > 0;
- }
- if ( element instanceof ILaunch ) {
- return true;
- }
- if ( element instanceof ILaunchManager ) {
- return ((ILaunchManager)element).getLaunches().length > 0;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- @Override
- public Object[] getElements( Object inputElement ) {
- return getChildren( inputElement );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- @Override
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
- }
- }
-
- private CBreakpointFilteringPage fPage;
-
- private CheckboxTreeViewer fThreadViewer;
-
- private ThreadFilterContentProvider fContentProvider;
-
- private CheckHandler fCheckHandler;
-
- /**
- * Constructor for ThreadFilterEditor.
- */
- public ThreadFilterEditor( Composite parent, CBreakpointFilteringPage page ) {
- fPage = page;
- fContentProvider = new ThreadFilterContentProvider();
- fCheckHandler = new CheckHandler();
- createThreadViewer( parent );
- }
-
- protected CBreakpointFilteringPage getPage() {
- return fPage;
- }
-
- private void createThreadViewer( Composite parent ) {
- Label label = new Label( parent, SWT.NONE );
- label.setText( BreakpointsMessages.getString( "ThreadFilterEditor.0" ) ); //$NON-NLS-1$
- label.setFont( parent.getFont() );
- label.setLayoutData( new GridData() );
- GridData data = new GridData( GridData.FILL_BOTH );
- data.heightHint = 100;
- fThreadViewer = new CheckboxTreeViewer( parent, SWT.BORDER );
- fThreadViewer.addCheckStateListener( fCheckHandler );
- fThreadViewer.getTree().setLayoutData( data );
- fThreadViewer.getTree().setFont( parent.getFont() );
- fThreadViewer.setContentProvider( fContentProvider );
- fThreadViewer.setLabelProvider( DebugUITools.newDebugModelPresentation() );
- fThreadViewer.setInput( DebugPlugin.getDefault().getLaunchManager() );
- setInitialCheckedState();
- }
-
- /**
- * Returns the debug targets that appear in the tree
- */
- protected IDebugTarget[] getDebugTargets() {
- Object input = fThreadViewer.getInput();
- if ( !(input instanceof ILaunchManager) ) {
- return new IDebugTarget[0];
- }
- ILaunchManager launchManager = (ILaunchManager)input;
- return launchManager.getDebugTargets();
- }
-
- protected CheckboxTreeViewer getThreadViewer() {
- return fThreadViewer;
- }
-
- /**
- * Sets the initial checked state of the tree viewer.
- * The initial state should reflect the current state
- * of the breakpoint. If the breakpoint has a thread
- * filter in a given thread, that thread should be
- * checked.
- */
- protected void setInitialCheckedState() {
- ICBreakpointFilterExtension filterExtension = fPage.getFilterExtension();
- try {
- ICDebugTarget[] targets = filterExtension.getTargetFilters();
- for( int i = 0; i < targets.length; i++ ) {
- ICThread[] filteredThreads = filterExtension.getThreadFilters( targets[i] );
- if ( filteredThreads != null ) {
- for ( int j = 0; j < filteredThreads.length; ++j )
- fCheckHandler.checkThread( filteredThreads[j], true );
- }
- else {
- fCheckHandler.checkTarget( targets[i], true );
- }
- }
- }
- catch( CoreException e ) {
- CDebugUIPlugin.log( e );
- }
- }
-
- protected void doStore() {
- ICBreakpointFilterExtension filterExtension = fPage.getFilterExtension();
- IDebugTarget[] targets = getDebugTargets();
- for ( int i = 0; i < targets.length; ++i ) {
- if ( !(targets[i] instanceof ICDebugTarget) )
- continue;
- try {
- if ( getThreadViewer().getChecked( targets[i] ) ) {
- if ( getThreadViewer().getGrayed( targets[i] ) ) {
- ICThread[] threads = getTargetThreadFilters( (ICDebugTarget)targets[i] );
- filterExtension.setThreadFilters( threads );
- }
- else {
- filterExtension.setTargetFilter( (ICDebugTarget)targets[i] );
- }
- }
- else {
- filterExtension.removeTargetFilter( (ICDebugTarget)targets[i] );
- }
- DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged( fPage.getBreakpoint() );
- }
- catch( CoreException e ) {
- CDebugUIPlugin.log( e );
- }
- }
- }
-
- private ICThread[] getTargetThreadFilters( ICDebugTarget target ) {
- Object[] threads = ((ITreeContentProvider)getThreadViewer().getContentProvider()).getChildren( target );
- ArrayList<ICThread> list = new ArrayList<ICThread>( threads.length );
- for ( int i = 0; i < threads.length; ++i ) {
- if ( getThreadViewer().getChecked( threads[i] ) )
- list.add( (ICThread)threads[i] );
- }
- return list.toArray( new ICThread[list.size()] );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java
index 66a530f20e..fbcf59efb0 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/ToggleCBreakpointTester.java
@@ -21,7 +21,6 @@ import org.eclipse.cdt.core.model.IFunctionDeclaration;
import org.eclipse.cdt.core.model.IMethodDeclaration;
import org.eclipse.cdt.core.model.IVariableDeclaration;
import org.eclipse.cdt.debug.core.CDebugUtils;
-import org.eclipse.cdt.debug.internal.ui.disassembly.editor.DisassemblyEditor;
import org.eclipse.cdt.internal.ui.editor.CEditor;
import org.eclipse.cdt.internal.ui.editor.asm.AsmTextEditor;
import org.eclipse.core.expressions.PropertyTester;
@@ -84,10 +83,6 @@ public class ToggleCBreakpointTester extends PropertyTester {
return true; // can't figure the associated project, enable it by default.
}
}
- } else if ("isDisassemblyEditorSupportsCBreakpoint".equals(property) && (receiver instanceof DisassemblyEditor)) { //$NON-NLS-1$
- if (!CDebugUtils.isCustomToggleBreakpointFactory())
- return true;
- // No additional check is required, the check for the receiver is enough.
// test for IVariableDeclaration, IFunctionDeclaration, IMethodDeclaration
} else if ("isCDeclarationSupportsCBreakpoint".equals(property) && (receiver instanceof List<?>)) { //$NON-NLS-1$
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/AbstractRegisterGroupCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/AbstractRegisterGroupCommandHandler.java
deleted file mode 100644
index 4d61e76638..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/AbstractRegisterGroupCommandHandler.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- * Alvaro Sanchez-Leon (Ericsson) - Support Register Groups (Bug 235747)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.IPersistableRegisterGroup;
-import org.eclipse.cdt.debug.core.model.IRegisterDescriptor;
-import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
-import org.eclipse.cdt.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.cdt.debug.internal.ui.actions.RegisterGroupDialog;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-
-public abstract class AbstractRegisterGroupCommandHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.IRegisterGroupActionsTarget#addRegisterGroup(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void addRegisterGroup(IStructuredSelection selection) {
- ICDebugTarget t = getDebugTarget(selection);
- if (t != null) {
- // Using Debug model
- try {
- IRegisterDescriptor[] registers = t.getRegisterDescriptors();
- RegisterGroupDialog dialog = new RegisterGroupDialog(Display.getCurrent().getActiveShell(), registers);
- if (dialog.open() == Window.OK) {
- t.addRegisterGroup(dialog.getName(), dialog.getDescriptors());
- }
- } catch (DebugException e) {
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.IRegisterGroupActionsTarget#canAddRegisterGroup(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public boolean canAddRegisterGroup(IStructuredSelection selection) {
- ICDebugTarget target = getDebugTarget(selection);
- return (target != null) ? target.isSuspended() : false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.IRegisterGroupActionsTarget#editRegisterGroup(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void editRegisterGroup(IStructuredSelection selection) {
- IPersistableRegisterGroup group = getRegisterGroup(selection);
- if (group == null) {
- return;
- }
-
- IRegisterDescriptor[] all;
- try {
- all = ((CDebugTarget) group.getDebugTarget()).getRegisterDescriptors();
- RegisterGroupDialog dialog = new RegisterGroupDialog(Display.getCurrent().getActiveShell(),
- group.getName(), all, group.getRegisterDescriptors());
- if (dialog.open() == Window.OK) {
- IDebugTarget target = group.getDebugTarget();
- if (target instanceof ICDebugTarget) {
- ((ICDebugTarget) target).modifyRegisterGroup(group, dialog.getDescriptors());
- }
- }
- } catch (DebugException e) {
- CDebugUIPlugin.errorDialog(ActionMessages.getString("EditRegisterGroupActionDelegate.0"), e.getStatus()); //$NON-NLS-1$
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.IRegisterGroupActionsTarget#canEditRegisterGroup(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public boolean canEditRegisterGroup(IStructuredSelection selection) {
- IPersistableRegisterGroup group = getRegisterGroup(selection);
- return (group != null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.IRegisterGroupActionsTarget#removeRegisterGroups(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void removeRegisterGroups(IStructuredSelection selection) {
- IRegisterGroup[] groups = getRegisterGroups(selection);
- if (groups.length > 0) {
- IDebugTarget target = groups[0].getDebugTarget();
- if (target instanceof ICDebugTarget) {
- ((ICDebugTarget) target).removeRegisterGroups(groups);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.IRegisterGroupActionsTarget#canRemoveRegisterGroups(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public boolean canRemoveRegisterGroups(IStructuredSelection selection) {
- IRegisterGroup[] groups = getRegisterGroups(selection);
- if (groups.length > 0) {
- return true;
- }
-
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.IRegisterGroupActionsTarget#restoreDefaultGroups(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void restoreDefaultGroups(IStructuredSelection selection) {
- getDebugTarget(selection).restoreDefaultRegisterGroups();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.actions.IRegisterGroupActionsTarget#canRestoreDefaultGroups(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public boolean canRestoreDefaultGroups(IStructuredSelection selection) {
- ICDebugTarget target = getDebugTarget(selection);
- return (target != null) ? target.isSuspended() : false;
- }
-
- private ICDebugTarget getDebugTarget(IStructuredSelection selection) {
-
- Object element = selection.getFirstElement();
-
- if (element instanceof IDebugElement) {
- return ((IDebugElement) element).getDebugTarget().getAdapter(ICDebugTarget.class);
- }
- return null;
- }
-
- private IPersistableRegisterGroup getRegisterGroup(IStructuredSelection ss) {
- IPersistableRegisterGroup selectedGroup = null;
- if (!ss.isEmpty()) {
- Object s = ss.getFirstElement();
- if (s instanceof IPersistableRegisterGroup) {
- selectedGroup = (IPersistableRegisterGroup) s;
- }
- }
-
- return selectedGroup;
- }
-
- private IRegisterGroup[] getRegisterGroups(IStructuredSelection ss) {
- ArrayList<IRegisterGroup> list = new ArrayList<IRegisterGroup>();
- for (Iterator<?> iterator = ss.iterator(); iterator.hasNext();) {
- Object selection = iterator.next();
- if (selection instanceof IRegisterGroup) {
- list.add((IRegisterGroup) selection);
- }
- }
-
- return list.toArray(new IRegisterGroup[list.size()]);
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/AddRegisterGroupCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/AddRegisterGroupCommandHandler.java
deleted file mode 100644
index 9563d2ad9a..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/AddRegisterGroupCommandHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Ericsson 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:
- * Marc Khouzam (Ericsson) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.commands;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Command handler to trigger an AddRegisterGroup operation
- */
-public class AddRegisterGroupCommandHandler extends AbstractRegisterGroupCommandHandler {
-
- public void setEnabled(Object evaluationContext) {
- boolean state = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
- if (s instanceof IStructuredSelection) {
- state = canAddRegisterGroup((IStructuredSelection)s);
- }
- }
- setBaseEnabled(state);
- }
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection instanceof IStructuredSelection) {
- addRegisterGroup((IStructuredSelection)selection);
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/EditRegisterGroupCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/EditRegisterGroupCommandHandler.java
deleted file mode 100644
index ba376b87e8..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/EditRegisterGroupCommandHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Ericsson 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:
- * Marc Khouzam (Ericsson) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.commands;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Command handler to trigger an AddRegisterGroup operation
- */
-public class EditRegisterGroupCommandHandler extends AbstractRegisterGroupCommandHandler {
-
- public void setEnabled(Object evaluationContext) {
- boolean state = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
- if (s instanceof IStructuredSelection) {
- state = canEditRegisterGroup((IStructuredSelection)s);
- }
- }
- setBaseEnabled(state);
- }
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection instanceof IStructuredSelection) {
- editRegisterGroup((IStructuredSelection)selection);
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/LoadAllSymbolsCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/LoadAllSymbolsCommandHandler.java
deleted file mode 100644
index 82e27d01f2..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/LoadAllSymbolsCommandHandler.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software System 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:
- * Elena Laskavaia (QNX) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.commands;
-
-import org.eclipse.cdt.debug.internal.ui.actions.LoadSymbolsForAllActionDelegate;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-public class LoadAllSymbolsCommandHandler extends AbstractHandler implements IHandler {
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- final IWorkbenchPart part = HandlerUtil.getActivePart(event);
-
- if (part instanceof IViewPart) {
- LoadSymbolsForAllActionDelegate delegate = new LoadSymbolsForAllActionDelegate();
- delegate.init((IViewPart) part);
- delegate.run(new Action() {
- });
- delegate.dispose();
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/LoadSymbolsCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/LoadSymbolsCommandHandler.java
deleted file mode 100644
index 44bb6aae0c..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/LoadSymbolsCommandHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 QNX Software System 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:
- * Elena Laskavaia (QNX) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.commands;
-
-import org.eclipse.cdt.debug.internal.ui.actions.LoadModuleSymbolsActionDelegate;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-public class LoadSymbolsCommandHandler extends AbstractHandler implements IHandler {
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- final IWorkbenchPart part = HandlerUtil.getActivePart(event);
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- LoadModuleSymbolsActionDelegate delegate = new LoadModuleSymbolsActionDelegate();
- IAction action = new Action() { };// fake action
- delegate.selectionChanged(action, selection);
- delegate.setActivePart(action, part);
- if (action.isEnabled())
- delegate.run(action);
- delegate.dispose();
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/RemoveRegisterGroupsCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/RemoveRegisterGroupsCommandHandler.java
deleted file mode 100644
index 540c74d6ab..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/RemoveRegisterGroupsCommandHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Ericsson 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:
- * Marc Khouzam (Ericsson) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.commands;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Command handler to trigger a RemoveRegisterGroups operation
- */
-public class RemoveRegisterGroupsCommandHandler extends AbstractRegisterGroupCommandHandler {
-
- public void setEnabled(Object evaluationContext) {
- boolean state = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
- if (s instanceof IStructuredSelection) {
- state = canRemoveRegisterGroups((IStructuredSelection)s);
- }
- }
- setBaseEnabled(state);
- }
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection instanceof IStructuredSelection) {
- removeRegisterGroups((IStructuredSelection)selection);
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/RestoreRegisterGroupsCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/RestoreRegisterGroupsCommandHandler.java
deleted file mode 100644
index 3943cca840..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/RestoreRegisterGroupsCommandHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Ericsson 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:
- * Marc Khouzam (Ericsson) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.commands;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Command handler to trigger an AddRegisterGroup operation
- */
-public class RestoreRegisterGroupsCommandHandler extends AbstractRegisterGroupCommandHandler {
-
- public void setEnabled(Object evaluationContext) {
- boolean state = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
- if (s instanceof IStructuredSelection) {
- state = canRestoreDefaultGroups((IStructuredSelection)s);
- }
- }
- setBaseEnabled(state);
- }
-
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection instanceof IStructuredSelection) {
- restoreDefaultGroups((IStructuredSelection)selection);
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ViewMemoryHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ViewMemoryHandler.java
deleted file mode 100644
index 6f3d2eb4c7..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ViewMemoryHandler.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Nokia 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:
- * Nokia - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.cdt.debug.core.model.ICVariable;
-import org.eclipse.cdt.debug.internal.ui.views.memory.AddMemoryBlocks;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Handler for viewing variable in memory view command, based on
- * org.eclipse.cdt.debug.internal.ui.actions.ViewMemoryActionDelegate
- *
- */
-public class ViewMemoryHandler extends AbstractHandler {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection instanceof IStructuredSelection) {
- List<Object> list = new ArrayList<Object>();
- Iterator<?> iter = ((IStructuredSelection)selection).iterator();
- while (iter.hasNext()) {
- Object obj = iter.next();
- if (obj instanceof ICVariable) {
- list.add(obj);
- }
- }
- ICVariable[] variables = list.toArray(new ICVariable[list.size()]);
- showInMemoryView(variables);
- }
- return null;
- }
-
- private void showInMemoryView(ICVariable[] variables) {
- try {
- IWorkbenchPage page = CDebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IViewPart newView = page.showView(IDebugUIConstants.ID_MEMORY_VIEW, null, IWorkbenchPage.VIEW_ACTIVATE);
- IMemoryRenderingSite memSite = (IMemoryRenderingSite) newView;
- new AddMemoryBlocks().addMemoryBlocksForVariables(variables, memSite);
- } catch (ClassCastException e) {
- CDebugUIPlugin.log(e);
- } catch (PartInitException e) {
- CDebugUIPlugin.log(e);
- } catch (DebugException e) {
- CDebugUIPlugin.log(e);
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/CDIDisassemblyRetrieval.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/CDIDisassemblyRetrieval.java
deleted file mode 100644
index fbe0a8608a..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/CDIDisassemblyRetrieval.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2015 Wind River Systems, Inc. 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:
- * Anton Leherbauer (Wind River Systems) - initial API and implementation
- * Freescale Semiconductor - refactoring
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.disassembly.dsf;
-
-import java.math.BigInteger;
-
-import org.eclipse.cdt.core.IAddress;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
-import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICStackFrame;
-import org.eclipse.cdt.debug.core.model.IDisassemblyBlock;
-import org.eclipse.cdt.debug.internal.core.model.DisassemblyBlock;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.swt.widgets.Display;
-
-
-/**
- */
-public class CDIDisassemblyRetrieval implements IDisassemblyRetrieval {
-
- private ICDebugTarget fDebugTarget;
-
- /**
- * Constructor
- */
- public CDIDisassemblyRetrieval(ICDebugTarget debugTarget) {
- fDebugTarget= debugTarget;
- }
-
- /*
- * @see org.eclipse.cdt.debug.ui.infinitedisassembly.views.IDisassemblyRetrieval#asyncGetDisassembly(java.math.BigInteger, java.math.BigInteger, java.lang.String, int, org.eclipse.cdt.debug.ui.infinitedisassembly.views.IDisassemblyRetrieval.DisassemblyRequest)
- */
- @Override
- public void asyncGetDisassembly(final BigInteger startAddress, final BigInteger endAddress, final String file, final int lineNumber, final int lines, final boolean mixed, final DisassemblyRequest disassemblyRequest) {
- Runnable op= new Runnable() {
- @Override
- public void run() {
- ICDITarget cdiTarget= fDebugTarget.getAdapter(ICDITarget.class);
- try {
- ICDIMixedInstruction[] mixedInstructions= null;
- ICDIInstruction[] asmInstructions= null;
- if (file != null) {
- if (mixed) {
- mixedInstructions= cdiTarget.getMixedInstructions(file, lineNumber, lines);
- } else {
- asmInstructions= cdiTarget.getInstructions(file, lineNumber, lines);
- }
- }
- else if (startAddress != null) {
- if (mixed) {
- mixedInstructions= cdiTarget.getMixedInstructions(startAddress, endAddress);
- }
- if (mixedInstructions == null || mixedInstructions.length == 0) {
- mixedInstructions= null;
- asmInstructions= cdiTarget.getInstructions(startAddress, endAddress);
- } else if (mixedInstructions.length == 1 && mixedInstructions[0].getInstructions().length == 0) {
- mixedInstructions= null;
- asmInstructions= cdiTarget.getInstructions(startAddress, endAddress);
- }
- }
- if (mixedInstructions != null) {
- IDisassemblyBlock block= DisassemblyBlock.create(fDebugTarget.getDisassembly(), mixedInstructions);
- disassemblyRequest.setDisassemblyBlock(block);
- } else if (asmInstructions != null) {
- IDisassemblyBlock block= DisassemblyBlock.create(fDebugTarget.getDisassembly(), asmInstructions);
- disassemblyRequest.setDisassemblyBlock(block);
- }
- } catch (CDIException exc) {
- disassemblyRequest.setStatus(new Status(IStatus.ERROR, CDebugUIPlugin.getUniqueIdentifier(), exc.getDetailMessage(), exc));
- } catch (DebugException exc) {
- disassemblyRequest.setStatus(new Status(IStatus.ERROR, CDebugUIPlugin.getUniqueIdentifier(), exc.getMessage(), exc));
- } finally {
- disassemblyRequest.done();
- }
-
- }
- };
- Display.getDefault().asyncExec(op);
- }
-
- /*
- * @see org.eclipse.cdt.debug.ui.infinitedisassembly.views.IDisassemblyRetrieval#asyncGetFrameAddress(org.eclipse.debug.core.model.IStackFrame, org.eclipse.cdt.debug.ui.infinitedisassembly.views.IDisassemblyRetrieval.AddressRequest)
- */
- @Override
- public void asyncGetFrameAddress(final IStackFrame stackFrame, final AddressRequest addressRequest) {
- Runnable op= new Runnable() {
- @Override
- public void run() {
- if (stackFrame instanceof ICStackFrame) {
- IAddress address = ((ICStackFrame)stackFrame).getAddress();
- if (address != null ) {
- addressRequest.setAddress(address.getValue());
- } else {
- addressRequest.setStatus(new Status(IStatus.ERROR, CDebugUIPlugin.getUniqueIdentifier(), "Internal error: Cannot retrieve frame address")); //$NON-NLS-1$
- }
- } else {
- addressRequest.cancel();
- }
- addressRequest.done();
- }
- };
- Display.getDefault().asyncExec(op);
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java
deleted file mode 100644
index 1ffc3e6248..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java
+++ /dev/null
@@ -1,709 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Wind River Systems, Inc. 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
- * Freescale Semiconductor - refactoring
- * Patrick Chuong (Texas Instruments) - Bug fix (329682)
- * Patrick Chuong (Texas Instruments) - Bug fix (304108)
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.disassembly.dsf;
-
-import java.math.BigInteger;
-
-import org.eclipse.cdt.core.model.ITranslationUnit;
-import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
-import org.eclipse.cdt.debug.core.model.IAsmInstruction;
-import org.eclipse.cdt.debug.core.model.IAsmSourceLine;
-import org.eclipse.cdt.debug.core.model.ICDebugElement;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICStackFrame;
-import org.eclipse.cdt.debug.core.model.ICThread;
-import org.eclipse.cdt.debug.core.model.ICType;
-import org.eclipse.cdt.debug.core.model.ICValue;
-import org.eclipse.cdt.debug.core.model.IDisassemblyBlock;
-import org.eclipse.cdt.debug.internal.core.CRequest;
-import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
-import org.eclipse.cdt.debug.internal.core.model.CExpression;
-import org.eclipse.cdt.debug.internal.core.model.CStackFrame;
-import org.eclipse.cdt.debug.internal.ui.CDebugUIMessages;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Position;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * The CDI backend to the DSF disassembly view.
- *
- */
-public class DisassemblyBackendCdi extends AbstractDisassemblyBackend implements IDebugEventSetListener {
-
- private ICThread fTargetContext;
- private String fCdiSessionId;
- private ICStackFrame fTargetFrameContext;
- private CDIDisassemblyRetrieval fDisassemblyRetrieval;
- /* The frame level as the disassembly callback expects it (0 = topmost frame) */
- private int fFrameLevel;
-
- public DisassemblyBackendCdi() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#init(org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback)
- */
- @Override
- public void init(IDisassemblyPartCallback callback) {
- super.init(callback);
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#hasDebugContext()
- */
- @Override
- public boolean hasDebugContext() {
- return fTargetContext != null;
- }
-
- /**
- * Unlike DSF, CDI sessions don't have an ID. But to appease the DSF
- * Disassembly view, we fabricate one.
- *
- * @param debugElement
- * the debug element which represents the process being debugged
- * @return the session ID
- */
- private String getSessionId(ICDebugElement debugElement) {
- return "cdi-" + System.identityHashCode(debugElement.getDebugTarget()); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#setDebugContext(org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- public SetDebugContextResult setDebugContext(IAdaptable context) {
- assert supportsDebugContext(context) : "caller should not have invoked us"; //$NON-NLS-1$
-
- SetDebugContextResult result = new SetDebugContextResult();
-
- ICDebugTarget cdiDebugTarget = (ICDebugTarget)((ICDebugElement)context).getDebugTarget();
- String cdiSessionId = getSessionId(cdiDebugTarget);
-
- fDisassemblyRetrieval = new CDIDisassemblyRetrieval(cdiDebugTarget);
-
- if (!cdiSessionId.equals(fCdiSessionId)) {
- fTargetContext = null;
- fTargetFrameContext = null;
- result.contextChanged = true;
-
- if (context instanceof ICStackFrame) {
- fFrameLevel = 0;
- fTargetContext = (ICThread)((ICStackFrame)context).getThread();
- try {
- // Get the topmost stack frame. Note that the state of the
- // thread may have changed by now. It may be running, in
- // which case we'll get null here. See bugzilla 317226
- IStackFrame topFrame = fTargetContext.getTopStackFrame();
- if (topFrame != null) {
- fTargetFrameContext = (ICStackFrame)context;
-
- // CDI frame levels are ordered opposite of DSF. Frame 0 is the
- // root frame of the thread where in DSF it's the topmost frame
- // (where the PC is). Do a little math to flip reverse the value
- fFrameLevel = ((CStackFrame)topFrame).getLevel() - fTargetFrameContext.getLevel();
- }
- } catch (DebugException e) {
- }
- }
-
- if (fTargetContext != null) {
- result.sessionId = fCdiSessionId = cdiSessionId;
- }
- }
- else if (context instanceof ICStackFrame) {
- result.sessionId = fCdiSessionId;
- fTargetFrameContext = null;
- fFrameLevel = 0;
- ICThread newTargetContext = (ICThread)((ICStackFrame)context).getThread();
- ICThread oldTargetContext = fTargetContext;
- fTargetContext = newTargetContext;
- if (oldTargetContext == null) {
- result.contextChanged = true;
- } else if (/*oldTargetContext != null && */newTargetContext != null) {
- result.contextChanged = !oldTargetContext.getDebugTarget().equals(newTargetContext.getDebugTarget());
- }
- try {
- // Get the topmost stack frame. Note that the state of the
- // thread may have changed by now. It may be running, in
- // which case we'll get null here. See bugzilla 317226
- IStackFrame topFrame = fTargetContext.getTopStackFrame();
- if (topFrame != null) {
- fTargetFrameContext = (ICStackFrame)context;
-
- // CDI frame levels are ordered opposite of DSF. Frame 0 is the
- // root frame of the thread where in DSF it's the topmost frame
- // (where the PC is). Do a little math to flip reverse the value
- fFrameLevel = ((CStackFrame)topFrame).getLevel() - fTargetFrameContext.getLevel();
- }
- } catch (DebugException e) {
- }
- if (!result.contextChanged) {
- fCallback.gotoFrame(fFrameLevel);
- }
- } else {
- fTargetContext = null;
- fTargetFrameContext = null;
- result.contextChanged = true;
- }
-
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#supportsDebugContext(org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- public boolean supportsDebugContext(IAdaptable context) {
- return supportsDebugContext_(context);
- }
-
- /**
- * @param context
- * @return
- */
- public static boolean supportsDebugContext_(IAdaptable context) {
- return (context != null) && (context.getAdapter(ICDebugElement.class) != null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#clearDebugContext()
- */
- @Override
- public void clearDebugContext() {
- fTargetContext= null;
- fCdiSessionId = null;
- fTargetFrameContext = null;
- fDisassemblyRetrieval = null;
- fFrameLevel = 0;
- }
-
- private class AddressRequest extends CRequest implements IDisassemblyRetrieval.AddressRequest {
- private BigInteger fAddress;
- @Override
- public BigInteger getAddress() { return fAddress; }
- @Override
- public void setAddress(BigInteger address) { fAddress = address; }
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#retrieveFrameAddress(int)
- */
- @Override
- public void retrieveFrameAddress(final int targetFrame) {
- try {
- final IStackFrame[] stackFrames= fTargetContext.getStackFrames();
- if (stackFrames.length <= targetFrame) {
- fCallback.setUpdatePending(false);
- return;
- }
- IStackFrame stackFrame= stackFrames[targetFrame];
- fDisassemblyRetrieval.asyncGetFrameAddress(stackFrame, new AddressRequest() {
- @Override
- public void done() {
- fCallback.setUpdatePending(false);
- if (isSuccess()) {
- BigInteger address= getAddress();
- if (targetFrame == 0) {
- fCallback.updatePC(address);
- } else {
- fCallback.gotoFrame(targetFrame, address);
- }
- }
- }
- });
-
- } catch (DebugException exc) {
- DisassemblyUtils.internalError(exc);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#getFrameLevel()
- */
- @Override
- public int getFrameLevel() {
- return fFrameLevel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#isSuspended()
- */
- @Override
- public boolean isSuspended() {
- return fTargetContext != null && fTargetContext.isSuspended();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#getFrameFile()
- */
- @Override
- public String getFrameFile() {
- return fTargetFrameContext != null ? fTargetFrameContext.getFile() : null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#getFrameLine()
- */
- @Override
- public int getFrameLine() {
- return fTargetFrameContext.getFrameLineNumber();
- }
-
- private class DisassemblyRequest extends CRequest implements IDisassemblyRetrieval.DisassemblyRequest {
- private IDisassemblyBlock fBlock;
- @Override
- public IDisassemblyBlock getDisassemblyBlock() { return fBlock; }
- @Override
- public void setDisassemblyBlock(IDisassemblyBlock block) { fBlock = block; }
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyBackend#retrieveDisassembly(java.math.BigInteger, java.math.BigInteger, java.lang.String, boolean, boolean, boolean, int, int, int)
- */
- @Override
- public void retrieveDisassembly(final BigInteger startAddress,
- BigInteger endAddress, final String file, int lineNumber, final int lines, final boolean mixed,
- final boolean showSymbols, final boolean showDisassembly, final int linesHint) {
-
- if (fTargetContext == null || fTargetContext.isTerminated()) {
- return;
- }
- final BigInteger addressLength= BigInteger.valueOf(lines * 4);
- if (endAddress.subtract(startAddress).compareTo(addressLength) > 0) {
- endAddress= startAddress.add(addressLength);
- }
- // make sure address range is no less than 32 bytes
- // this is an attempt to get better a response from the backend (bug 302925)
- final BigInteger finalEndAddress= startAddress.add(BigInteger.valueOf(32)).max(endAddress);
- final IDisassemblyRetrieval.DisassemblyRequest disassemblyRequest= new DisassemblyRequest() {
- @Override
- public void done() {
- if (isSuccess() && getDisassemblyBlock() != null) {
- if (!insertDisassembly(startAddress, finalEndAddress, getDisassemblyBlock(), mixed, showSymbols, showDisassembly)) {
- // did not get disassembly data for startAddress - try fallbacks
- if (file != null) {
- // previous attempt used the file; retry using the address
- fCallback.setUpdatePending(true);
- retrieveDisassembly(startAddress, finalEndAddress, null, -1, lines, mixed, showSymbols, showDisassembly, linesHint);
- } else if (mixed) {
- // retry using non-mixed mode
- fCallback.setUpdatePending(true);
- retrieveDisassembly(startAddress, finalEndAddress, null, -1, lines, false, showSymbols, showDisassembly, linesHint);
- } else {
- // give up
- fCallback.doScrollLocked(new Runnable() {
- @Override
- public void run() {
- fCallback.insertError(startAddress, "Unable to retrieve disassembly data from backend."); //$NON-NLS-1$
- }
- });
- }
- }
- } else {
- final IStatus status= getStatus();
- if (status != null && !status.isOK()) {
- fCallback.doScrollLocked(new Runnable() {
- @Override
- public void run() {
- fCallback.insertError(startAddress, status.getMessage());
- }
- });
- }
- fCallback.setUpdatePending(false);
- }
- }
- };
- fDisassemblyRetrieval.asyncGetDisassembly(startAddress, finalEndAddress, file, lineNumber, lines, mixed, disassemblyRequest);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#insertSource(org.eclipse.jface.text.Position, java.math.BigInteger, java.lang.String, int)
- */
- @Override
- public Object insertSource(Position pos, BigInteger address,
- String file, int lineNumber) {
- ISourceLocator locator = fTargetContext.getLaunch().getSourceLocator();
- if (locator instanceof ISourceLookupDirector) {
- return ((ISourceLookupDirector)locator).getSourceElement(file);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#hasFrameContext()
- */
- @Override
- public boolean hasFrameContext() {
- return fTargetFrameContext != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyBackend#gotoSymbol(java.lang.String)
- */
- @Override
- public void gotoSymbol(String symbol) {
- final BigInteger address = evaluateAddressExpression(symbol, false);
- if (address != null) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.gotoAddress(address);
- }});
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#evaluateSymbolAddress(java.lang.String, boolean)
- */
- @Override
- public BigInteger evaluateAddressExpression(String symbol, final boolean suppressError) {
- if (fTargetFrameContext != null) {
- try {
- // This logic was lifted from CMemoryBlockRetrievalExtension.getExtendedMemoryBlock(String, Object)
- CStackFrame cstackFrame = (CStackFrame)fTargetFrameContext;
- ICDIExpression cdiExpression = cstackFrame.getCDITarget().createExpression(symbol);
- CExpression cdtExpression = new CExpression(cstackFrame, cdiExpression, null);
- IValue value = cdtExpression.getValue();
- if (value instanceof ICValue) {
- ICType type = ((ICValue)value).getType();
- if (type != null) {
- // get the address for the expression, allow all types
- String rawExpr = cdtExpression.getExpressionString();
- String voidExpr = "(void *)(" + rawExpr + ')'; //$NON-NLS-1$
- String attempts[] = { rawExpr, voidExpr };
- for (int i = 0; i < attempts.length; i++) {
- String expr = attempts[i];
- String addressStr = cstackFrame.evaluateExpressionToString(expr);
- if (addressStr != null) {
- try {
- return (addressStr.startsWith("0x")) ? new BigInteger(addressStr.substring(2), 16) : new BigInteger(addressStr); //$NON-NLS-1$
-
- } catch (NumberFormatException e) {
- if (i >= attempts.length) {
- throw new DebugException(new Status(IStatus.ERROR, CDebugUIPlugin.PLUGIN_ID,
- MessageFormat.format(CDebugUIMessages.getString("DisassemblyBackendCdi_Symbol_Evaluation_Unusable"), new String[]{symbol}))); //$NON-NLS-1$
- }
- }
- }
- }
- }
- }
- else {
- throw new DebugException(new Status(IStatus.ERROR, CDebugUIPlugin.PLUGIN_ID,
- MessageFormat.format(CDebugUIMessages.getString("DisassemblyBackendCdi_Symbol_Didnt_Evaluate"), new String[]{symbol}))); //$NON-NLS-1$
- }
- }
- catch (final CDIException exc) {
- if (!suppressError) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(),
- CDebugUIMessages.getString("DisassemblyBackendCdi_Error_Dlg_Title"), //$NON-NLS-1$
- null, new Status(IStatus.ERROR, CDebugUIPlugin.PLUGIN_ID, exc.getLocalizedMessage()));
- }});
- }
- }
- catch (final DebugException exc) {
- if (!suppressError) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(),
- CDebugUIMessages.getString("DisassemblyBackendCdi_Error_Dlg_Title"), //$NON-NLS-1$
- null, exc.getStatus());
- }});
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyBackend#retrieveDisassembly(java.lang.String, int, java.math.BigInteger, boolean, boolean, boolean)
- */
- @Override
- public void retrieveDisassembly(String file, int lines,
- final BigInteger endAddress, final boolean mixed, final boolean showSymbols,
- final boolean showDisassembly) {
- final IDisassemblyRetrieval.DisassemblyRequest disassemblyRequest= new DisassemblyRequest() {
- @Override
- public void done() {
- if (isSuccess() && getDisassemblyBlock() != null) {
- insertDisassembly(null, endAddress, getDisassemblyBlock(), mixed, showSymbols, showDisassembly);
- } else {
- final IStatus status= getStatus();
- if (status != null && !status.isOK()) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, getStatus()); //$NON-NLS-1$
- }
- });
- }
- fCallback.setUpdatePending(false);
- }
- }
- };
-
- assert !fCallback.getUpdatePending();
- fCallback.setUpdatePending(true);
- fDisassemblyRetrieval.asyncGetDisassembly(null, endAddress, file, 1, lines, mixed, disassemblyRequest);
- }
-
- /**
- * @param startAddress
- * an address the caller is hoping will be covered by this
- * insertion. I.e., [disassemblyBlock] may or may not contain
- * that address; the caller wants to know if it does, and so we
- * indicate that via our return value. Can be null to indicate n/a,
- * in which case we return true as long as any instruction was inserted
- * @param endAddress
- * cut-off address. Any elements in [disassemblyBlock] that
- * extend beyond this address are ignored.
- * @param disassemblyBlock
- * @param mixed
- * @param showSymbols
- * @param showDisassembly
- * @return whether [startAddress] was inserted
- */
- private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IDisassemblyBlock disassemblyBlock, boolean mixed, boolean showSymbols, boolean showDisassembly) {
- if (!fCallback.hasViewer() || fCdiSessionId == null) {
- // return true to avoid a retry
- return true;
- }
-
- if (!fCallback.getUpdatePending()) {
- // safe-guard in case something weird is going on
- assert false;
- // return true to avoid a retry
- return true;
- }
-
- // indicates whether [startAddress] was inserted
- boolean insertedStartAddress = startAddress == null;
-
- try {
- fCallback.lockScroller();
-
- final IDisassemblyDocument document = fCallback.getDocument(); // for convenience
- IAsmSourceLine[] srcLines= disassemblyBlock.getSourceLines();
- AddressRangePosition p = null;
- Object srcElement= disassemblyBlock.getSourceElement();
- for (int i = 0; i < srcLines.length; i++) {
- IAsmSourceLine srcLine= srcLines[i];
-
- // If the caller doesn't want mixed, set line number to -1 so we
- // create a pure disassembly position object
- int lineNumber= mixed ? srcLine.getLineNumber() - 1 : -1;
-
- IAsmInstruction[] instructions= srcLine.getInstructions();
- for (int j = 0; j < instructions.length; j++) {
- IAsmInstruction instruction = instructions[j];
- BigInteger address= instruction.getAdress().getValue();
- if (startAddress == null) {
- startAddress = address;
- fCallback.setGotoAddressPending(address);
- }
- if (p == null || !p.containsAddress(address)) {
- p = fCallback.getPositionOfAddress(address);
- }
- if (p instanceof ErrorPosition && p.fValid) {
- p.fValid = false;
- document.addInvalidAddressRange(p);
- } else if (p == null || address.compareTo(endAddress) > 0) {
- return insertedStartAddress;
- } else if (p.fValid) {
- if (srcElement != null && lineNumber >= 0 || p.fAddressLength == BigInteger.ONE) {
- // override probably unaligned disassembly
- p.fValid = false;
- document.addInvalidAddressRange(p);
- } else {
- return insertedStartAddress;
- }
- }
- boolean hasSource= false;
- String compilationPath= null;
- if (srcElement != null && lineNumber >= 0) {
- if (srcElement instanceof LocalFileStorage) {
- compilationPath = ((LocalFileStorage)srcElement).getFullPath().toString();
- }
- else if (srcElement instanceof IFile) {
- compilationPath = ((IFile)srcElement).getLocation().toString();
- }
- else if (srcElement instanceof java.io.File) {
- compilationPath = ((java.io.File)srcElement).getAbsolutePath();
- }
- else if (srcElement instanceof ITranslationUnit) {
- IPath location = ((ITranslationUnit) srcElement).getLocation();
- if (location != null) {
- compilationPath = location.toString();
- }
- }
- else {
- assert false : "missing support for source element of type " + srcElement.getClass().toString(); //$NON-NLS-1$
- }
- if (compilationPath != null) {
- p = fCallback.insertSource(p, address, compilationPath, lineNumber);
- hasSource = fCallback.getStorageForFile(compilationPath) != null;
- }
- else {
- hasSource = false;
- }
- }
- // insert symbol label
- final String functionName= instruction.getFunctionName();
- if (functionName != null && functionName.length() > 0 && instruction.getOffset() == 0) {
- p = document.insertLabel(p, address, functionName, showSymbols && (!hasSource || showDisassembly));
- }
- // determine instruction byte length
- BigInteger instrLength= null;
- if (j < instructions.length - 1) {
- instrLength= instructions[j+1].getAdress().distanceTo(instruction.getAdress()).abs();
- } else if (i < srcLines.length - 1) {
- int nextSrcLineIdx= i+1;
- while (nextSrcLineIdx < srcLines.length) {
- IAsmInstruction[] nextInstrs= srcLines[nextSrcLineIdx].getInstructions();
- if (nextInstrs.length > 0) {
- instrLength= nextInstrs[0].getAdress().distanceTo(instruction.getAdress()).abs();
- break;
- }
- ++nextSrcLineIdx;
- }
- if (nextSrcLineIdx >= srcLines.length) {
- break;
- }
- } else {
-// if (instructions.length == 1) {
-// if (p.fAddressLength.compareTo(BigInteger.valueOf(8)) <= 0) {
-// instrLength= p.fAddressLength;
-// }
-// }
- }
- if (instrLength == null) {
- // cannot determine length of last instruction
- break;
- }
- final String opCode;
- // insert function name+offset instead of opcode bytes
- if (functionName != null && functionName.length() > 0) {
- opCode= functionName + '+' + instruction.getOffset();
- } else {
- opCode= ""; //$NON-NLS-1$
- }
- if (!showDisassembly && hasSource) {
- p = document.insertDisassemblyLine(p, address, instrLength.intValue(), opCode, "", compilationPath, lineNumber); //$NON-NLS-1$
- } else {
- p = document.insertDisassemblyLine(p, address, instrLength.intValue(), opCode, instruction.getInstructionText(), compilationPath, lineNumber); //$NON-NLS-1
- }
- insertedStartAddress= insertedStartAddress || address.compareTo(startAddress) == 0;
- if (p == null && insertedStartAddress) {
- break;
- }
- }
- }
-
-
- } catch (BadLocationException e) {
- // should not happen
- DisassemblyUtils.internalError(e);
- } finally {
- fCallback.setUpdatePending(false);
- if (insertedStartAddress) {
- fCallback.updateInvalidSource();
- fCallback.unlockScroller();
- fCallback.doPending();
- fCallback.updateVisibleArea();
- } else {
- fCallback.unlockScroller();
- }
- }
- return insertedStartAddress;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- @Override
- public void handleDebugEvents(DebugEvent[] events) {
- for (DebugEvent event : events) {
- if (event.getKind() == DebugEvent.TERMINATE) {
- Object eventSource = event.getSource();
- if ((eventSource instanceof CDebugTarget) && (getSessionId((CDebugTarget)eventSource).equals(fCdiSessionId))) {
- fCallback.handleTargetEnded();
- return;
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#dispose()
- */
- @Override
- public void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#evaluateExpression(java.lang.String)
- */
- @Override
- public String evaluateExpression(String expression) {
- // This is called to service text hovering. We either resolve the
- // expression or we don't. No error reporting needed.
- if (fTargetFrameContext != null) {
- try {
- // This logic was lifted from CMemoryBlockRetrievalExtension.getExtendedMemoryBlock(String, Object)
- CStackFrame cstackFrame = (CStackFrame)fTargetFrameContext;
- ICDIExpression cdiExpression = cstackFrame.getCDITarget().createExpression(expression);
- CExpression cdtExpression = new CExpression(cstackFrame, cdiExpression, null);
- IValue value = cdtExpression.getValue();
- if (value instanceof ICValue) {
- ICType type = ((ICValue)value).getType();
- if (type != null) {
- return cstackFrame.evaluateExpressionToString(cdtExpression.getExpressionString());
- }
- }
- }
- catch (Exception exc) {
-
- }
- }
- return ""; //$NON-NLS-1$
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdiFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdiFactory.java
deleted file mode 100644
index b4c5e4cf2d..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdiFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Freescale Semiconductor, Inc. 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:
- * Freescale Semiconductor - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.disassembly.dsf;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IAdapterFactory;
-
-public class DisassemblyBackendCdiFactory implements IAdapterFactory {
-
- private static final Class<?>[] ADAPTERS = { IDisassemblyBackend.class };
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (IDisassemblyBackend.class.equals(adapterType)) {
- if (adaptableObject instanceof IAdaptable && DisassemblyBackendCdi.supportsDebugContext_((IAdaptable)adaptableObject)) {
- return new DisassemblyBackendCdi();
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- @SuppressWarnings("rawtypes")
- public Class[] getAdapterList() {
- return ADAPTERS;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/editor/DisassemblyEditor.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/editor/DisassemblyEditor.java
deleted file mode 100644
index 957e6416e1..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/editor/DisassemblyEditor.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2015 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.disassembly.editor;
-
-import org.eclipse.cdt.debug.core.disassembly.IDisassemblyContextProvider;
-import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
-import org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CBreakpointPropertiesRulerAction;
-import org.eclipse.cdt.debug.internal.ui.actions.breakpoints.EnableDisableBreakpointRulerAction;
-import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DisassemblyDocumentProvider;
-import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DisassemblyPane;
-import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DocumentContentProvider;
-import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.VirtualDocument;
-import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.VirtualSourceViewer;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.actions.ToggleBreakpointAction;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusableEditor, IDebugContextListener, IPropertyChangeListener {
-
- private DisassemblyPane fDisassemblyPane;
-
- public DisassemblyEditor() {
- super();
- fDisassemblyPane = new DisassemblyPane( "#DisassemblyEditorContext", "#DisassemblyEditorRulerContext" ); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void doSave( IProgressMonitor monitor ) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSaveAs()
- */
- @Override
- public void doSaveAs() {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
- */
- @Override
- public void init( IEditorSite site, IEditorInput input ) throws PartInitException {
- setSite( site );
- setInput( input );
- ((DisassemblyDocumentProvider)getDocumentProvider()).
- getDocumentPresentation( input ).
- addPropertyChangeListener( this );
- DebugUITools.getDebugContextManager().addDebugContextListener( this );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#isDirty()
- */
- @Override
- public boolean isDirty() {
- // TODO Auto-generated method stub
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
- */
- @Override
- public boolean isSaveAsAllowed() {
- // TODO Auto-generated method stub
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void createPartControl( Composite parent ) {
- fDisassemblyPane.create( parent );
- createActions();
-
- // register the context menu such that other plugins may contribute to it
- if ( getSite() != null ) {
- getSite().registerContextMenu( fDisassemblyPane.getViewContextMenuId(), fDisassemblyPane.getTextMenuManager(), getViewer() );
- }
-
- if ( getSite() != null ) {
- getSite().registerContextMenu( fDisassemblyPane.getRulerContextMenuId(), fDisassemblyPane.getTextMenuManager(), getViewer() );
- }
-
- VirtualSourceViewer viewer = fDisassemblyPane.getViewer();
- IEditorInput input = getEditorInput();
- if ( input instanceof DisassemblyEditorInput ) {
- Object debugContext = ((DisassemblyEditorInput)input).getDebugContext();
- VirtualDocument document = (VirtualDocument)getDocumentProvider().getDocument( input );
- IAnnotationModel annotationModel = getDocumentProvider().getAnnotationModel( input );
- viewer.setDocument( document, annotationModel );
- ((VirtualDocument)viewer.getDocument()).getContentProvider().changeInput( viewer, document.getPresentationContext(), null, debugContext, document.getCurrentOffset() );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
- */
- @Override
- public void setFocus() {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#dispose()
- */
- @Override
- public void dispose() {
- DebugUITools.getDebugContextManager().removeDebugContextListener( this );
- ((DisassemblyDocumentProvider)getDocumentProvider()).
- getDocumentPresentation( getEditorInput() ).
- removePropertyChangeListener( this );
- getDocumentProvider().disconnect( getEditorInput() );
- fDisassemblyPane.dispose();
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
- */
- @Override
- public final void setInput( IEditorInput input ) {
- super.setInput( input );
- Object debugContext = ((DisassemblyEditorInput)input).getDebugContext();
- try {
- getDocumentProvider().connect( input );
- }
- catch( CoreException e ) {
- // shouldn't happen
- }
- VirtualDocument document = (VirtualDocument)getDocumentProvider().getDocument( input );
- VirtualSourceViewer viewer = getViewer();
- if ( document != null && viewer != null ) {
- DocumentContentProvider contentProvider = document.getContentProvider();
- Object oldInput = contentProvider.getInput();
- contentProvider.changeInput( getViewer(), document.getPresentationContext(), oldInput, debugContext, document.getCurrentOffset() );
-// getViewer().refresh( false, true );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
- */
- @Override
- public void debugContextChanged( DebugContextEvent event ) {
- ISelection selection = event.getContext();
- if ( selection instanceof IStructuredSelection ) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- Object context = ss.getFirstElement();
- if ( context != null ) {
- IDisassemblyContextProvider contextProvider = getDisassemblyContextProvider( context );
- if ( contextProvider != null ) {
- Object disassemblyContext = contextProvider.getDisassemblyContext( context );
- if ( disassemblyContext != null ) {
- DisassemblyEditorInput oldInput = (DisassemblyEditorInput)getEditorInput();
- if ( oldInput.getDisassemblyContext().equals( disassemblyContext ) ) {
- setInput( new DisassemblyEditorInput( context, disassemblyContext ) );
- }
- }
- }
- }
- }
- }
-
- private IDisassemblyContextProvider getDisassemblyContextProvider( Object element ) {
- IDisassemblyContextProvider adapter = null;
- if ( element instanceof IDisassemblyContextProvider ) {
- adapter = (IDisassemblyContextProvider)element;
- }
- else if ( element instanceof IAdaptable ) {
- IAdaptable adaptable = (IAdaptable)element;
- adapter = adaptable.getAdapter( IDisassemblyContextProvider.class );
- }
- return adapter;
- }
-
- private VirtualSourceViewer getViewer() {
- return fDisassemblyPane.getViewer();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#close(boolean)
- */
- @Override
- public void close( boolean save ) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#doRevertToSaved()
- */
- @Override
- public void doRevertToSaved() {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#getAction(java.lang.String)
- */
- @Override
- public IAction getAction( String actionId ) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#getDocumentProvider()
- */
- @Override
- public IDocumentProvider getDocumentProvider() {
- return CDebugUIPlugin.getDefault().getDisassemblyEditorManager().getDocumentProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#getHighlightRange()
- */
- @Override
- public IRegion getHighlightRange() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#getSelectionProvider()
- */
- @Override
- public ISelectionProvider getSelectionProvider() {
- VirtualSourceViewer viewer = getViewer();
- return ( viewer != null ) ? viewer.getSelectionProvider() : null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#isEditable()
- */
- @Override
- public boolean isEditable() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#removeActionActivationCode(java.lang.String)
- */
- @Override
- public void removeActionActivationCode( String actionId ) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#resetHighlightRange()
- */
- @Override
- public void resetHighlightRange() {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#selectAndReveal(int, int)
- */
- @Override
- public void selectAndReveal( int offset, int length ) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#setAction(java.lang.String, org.eclipse.jface.action.IAction)
- */
- @Override
- public void setAction( String actionID, IAction action ) {
- fDisassemblyPane.setAction( actionID, action );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#setActionActivationCode(java.lang.String, char, int, int)
- */
- @Override
- public void setActionActivationCode( String actionId, char activationCharacter, int activationKeyCode, int activationStateMask ) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#setHighlightRange(int, int, boolean)
- */
- @Override
- public void setHighlightRange( int offset, int length, boolean moveCursor ) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#showHighlightRangeOnly(boolean)
- */
- @Override
- public void showHighlightRangeOnly( boolean showHighlightRangeOnly ) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.ITextEditor#showsHighlightRangeOnly()
- */
- @Override
- public boolean showsHighlightRangeOnly() {
- // TODO Auto-generated method stub
- return false;
- }
-
- protected void createActions() {
- IVerticalRuler ruler = fDisassemblyPane.getVerticalRuler();
- IAction action= new ToggleBreakpointAction( this, null, ruler );
- setAction( IInternalCDebugUIConstants.ACTION_TOGGLE_BREAKPOINT, action );
- action= new EnableDisableBreakpointRulerAction( this, ruler );
- setAction( IInternalCDebugUIConstants.ACTION_ENABLE_DISABLE_BREAKPOINT, action );
- action= new CBreakpointPropertiesRulerAction( this, ruler );
- setAction( IInternalCDebugUIConstants.ACTION_BREAKPOINT_PROPERTIES, action );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- @Override
- public void propertyChange( PropertyChangeEvent event ) {
- getViewer().refresh();
- }
-
- @Override
- public Object getAdapter(Class adapter) {
- if (IDocument.class.equals(adapter)) {
- return getDocumentProvider().getDocument(getEditorInput());
- }
- return super.getAdapter(adapter);
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyAnnotationModel.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyAnnotationModel.java
deleted file mode 100644
index 7a7c99325b..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyAnnotationModel.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2012 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.disassembly.rendering;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.AnnotationModel;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-
-/**
- * Annotation model for Disassembly view.
- */
-public class DisassemblyAnnotationModel extends AnnotationModel {
-
- private DisassemblyEditorInput fInput;
-
-// private IDocument fDisassemblyDocument;
-
- /**
- * Constructor for DisassemblyAnnotationModel.
- */
- public DisassemblyAnnotationModel() {
- super();
- }
-
- protected void breakpointsAdded( final IBreakpoint[] breakpoints, final IDocument document ) {
- DisassemblyEditorInput input = getInput();
- if ( DisassemblyEditorInput.EMPTY_EDITOR_INPUT.equals( input ) ||
- DisassemblyEditorInput.PENDING_EDITOR_INPUT.equals( input ) )
- return;
- asyncExec( new Runnable() {
- @Override
- public void run() {
- breakpointsAdded0( breakpoints, document );
- }
- } );
- }
-
- protected void breakpointsRemoved( final IBreakpoint[] breakpoints, final IDocument document ) {
- DisassemblyEditorInput input = getInput();
- if ( DisassemblyEditorInput.EMPTY_EDITOR_INPUT.equals( input ) ||
- DisassemblyEditorInput.PENDING_EDITOR_INPUT.equals( input ) )
- return;
- asyncExec( new Runnable() {
- @Override
- public void run() {
- breakpointsRemoved0( breakpoints, document );
- }
- } );
- }
-
- protected void breakpointsChanged( final IBreakpoint[] breakpoints, final IDocument document ) {
- DisassemblyEditorInput input = getInput();
- if ( DisassemblyEditorInput.EMPTY_EDITOR_INPUT.equals( input ) ||
- DisassemblyEditorInput.PENDING_EDITOR_INPUT.equals( input ) )
- return;
- asyncExec( new Runnable() {
- @Override
- public void run() {
- breakpointsChanged0( breakpoints, document );
- }
- } );
- }
-
- protected void breakpointsAdded0( IBreakpoint[] breakpoints, IDocument document ) {
- for ( int i = 0; i < breakpoints.length; ++i ) {
- if ( breakpoints[i] instanceof ICLineBreakpoint && isApplicable( breakpoints[i] ) ) {
- addBreakpointAnnotation( (ICLineBreakpoint)breakpoints[i], document );
- }
- }
- fireModelChanged();
- }
-
- protected void breakpointsRemoved0( IBreakpoint[] breakpoints, IDocument document ) {
- removeAnnotations( findAnnotationsforBreakpoints( breakpoints ), true, false );
- }
-
- protected void breakpointsChanged0( IBreakpoint[] breakpoints, IDocument document ) {
- List annotations = findAnnotationsforBreakpoints( breakpoints );
- List markers = new ArrayList( annotations.size() );
- Iterator it = annotations.iterator();
- while( it.hasNext() ) {
- MarkerAnnotation ma = (MarkerAnnotation)it.next();
- markers.add( ma.getMarker() );
- modifyAnnotationPosition( ma, getPosition( ma ), false );
- }
- for ( int i = 0; i < breakpoints.length; ++i ) {
- if ( breakpoints[i] instanceof ICLineBreakpoint && !markers.contains( breakpoints[i].getMarker() ) ) {
- addBreakpointAnnotation( (ICLineBreakpoint)breakpoints[i], document );
- }
- }
- fireModelChanged();
- }
-
- protected DisassemblyEditorInput getInput() {
- return this.fInput;
- }
-
- protected void setInput( DisassemblyEditorInput input, IDocument document ) {
- DisassemblyEditorInput oldInput = this.fInput;
- this.fInput = input;
- if ( this.fInput != null && !this.fInput.equals( oldInput ) )
- updateAnnotations( document );
- }
-
- private boolean isApplicable( IBreakpoint breakpoint ) {
- return true;
- }
-
- private void addBreakpointAnnotation( ICLineBreakpoint breakpoint, IDocument document ) {
- Position position = createBreakpointPosition( breakpoint, document );
- if ( position != null ) {
- try {
- addAnnotation( createMarkerAnnotation( breakpoint ), position, false );
- }
- catch( BadLocationException e ) {
- }
- }
- }
-
- private Position createBreakpointPosition( ICLineBreakpoint breakpoint, IDocument document ) {
- Position position = null;
- DisassemblyEditorInput input = getInput();
- if ( input != null ) {
- int start = -1;
- if ( document != null ) {
- int instrNumber = input.getInstructionLine( breakpoint );
- if ( instrNumber > 0 ) {
- try {
- start = fDocument.getLineOffset( instrNumber - 1 );
- if ( start > -1 ) {
- // Avoid the document boundaries; see bugzilla 178485
- int lineLen = document.getLineLength(instrNumber - 1);
- if (start == 0) {
- start++;
- lineLen--;
- }
- if (start + lineLen == document.getLength()) {
- lineLen--;
- }
- return new Position( start, lineLen );
- }
- }
- catch( BadLocationException e ) {
- }
- }
- }
- }
- return position;
- }
-
- private MarkerAnnotation createMarkerAnnotation( IBreakpoint breakpoint ) {
- return new MarkerAnnotation( breakpoint.getMarker() );
- }
-
- protected void dispose() {
- }
-
- private List findAnnotationsforBreakpoints( IBreakpoint[] breakpoints ) {
- List annotations = new LinkedList();
- Iterator it = getAnnotationIterator();
- while ( it.hasNext() ) {
- Annotation ann = (Annotation)it.next();
- if ( ann instanceof MarkerAnnotation ) {
- IMarker marker = ((MarkerAnnotation)ann).getMarker();
- if ( marker != null ) {
- for ( int i = 0; i < breakpoints.length; ++i ) {
- if ( marker.equals( breakpoints[i].getMarker() ) ) {
- annotations.add( ann );
- }
- }
- }
- }
- }
- return annotations;
- }
-
- private void asyncExec( Runnable r ) {
- Display display = Display.getDefault();
- if ( display != null )
- display.asyncExec( r );
- }
-
- private void updateAnnotations( final IDocument document ) {
- asyncExec( new Runnable() {
- @Override
- public void run() {
- doUpdateAnnotations( document );
- }
- } );
- }
-
- protected void doUpdateAnnotations( IDocument document ) {
- breakpointsAdded0( DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(), document );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyEditorInput.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyEditorInput.java
deleted file mode 100644
index 7203b04cc7..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyEditorInput.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.disassembly.rendering;
-
-import java.util.Arrays;
-import org.eclipse.cdt.core.IAddress;
-import org.eclipse.cdt.debug.core.CDIDebugModel;
-import org.eclipse.cdt.debug.core.model.IAsmInstruction;
-import org.eclipse.cdt.debug.core.model.IAsmSourceLine;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
-import org.eclipse.cdt.debug.core.model.ICStackFrame;
-import org.eclipse.cdt.debug.core.model.IDisassembly;
-import org.eclipse.cdt.debug.core.model.IDisassemblyBlock;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * Editor input associated with a debug element.
- */
-public class DisassemblyEditorInput implements IEditorInput {
-
- public static final IEditorInput EMPTY_EDITOR_INPUT = new DisassemblyEditorInput();
-
- public static final IEditorInput PENDING_EDITOR_INPUT =
- new DisassemblyEditorInput() {
- @Override
- public String getContents() {
- return DisassemblyMessages.getString( "DisassemblyDocumentProvider.Pending_1" ); //$NON-NLS-1$
- }
- };
-
- /**
- * Disassembly block associated with this editor input
- */
- private IDisassemblyBlock fBlock;
-
- private String fContents = ""; //$NON-NLS-1$
-
- private IRegion[] fSourceRegions = new IRegion[0];
-
- /**
- * Constructor for DisassemblyEditorInput.
- */
- protected DisassemblyEditorInput() {
- }
-
- /**
- * Constructor for DisassemblyEditorInput.
- *
- * @param disassembly
- * @param instructions
- */
- private DisassemblyEditorInput( IDisassemblyBlock block) {
- fBlock = block;
- createContents();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- @Override
- public boolean exists() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- @Override
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- @Override
- public String getName() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- @Override
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- @Override
- public String getToolTipText() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter( Class adapter ) {
- return null;
- }
-
- public boolean contains( ICStackFrame frame ) {
- if ( fBlock != null ) {
- return fBlock.contains( frame );
- }
- return false;
- }
-
- public String getContents() {
- return fContents;
- }
-
- public int getInstructionLine( IAddress address ) {
- if ( fBlock != null ) {
- IAsmSourceLine[] lines = fBlock.getSourceLines();
- int result = 0;
- for ( int i = 0; i < lines.length; ++i ) {
- IAsmInstruction[] instructions = lines[i].getInstructions();
- if ( fBlock.isMixedMode() )
- ++result;
- for ( int j = 0; j < instructions.length; ++j ) {
- ++result;
- if ( address.equals( instructions[j].getAdress() ) ) {
- return result;
- }
- }
- }
- }
- return -1;
- }
-
- public int getInstructionLine( ICLineBreakpoint breakpoint ) {
- if ( fBlock != null ) {
- IDisassembly dis = fBlock.getDisassembly();
- if ( dis != null ) {
- ICDebugTarget target = dis.getDebugTarget().getAdapter( ICDebugTarget.class );
- if ( target != null ) {
- try {
- IAddress address = target.getBreakpointAddress( breakpoint );
- if ( address != null && !address.isZero() )
- return getInstructionLine( address );
- }
- catch( DebugException e ) {
- }
- }
- }
- }
- return -1;
- }
-
- public IAddress getAddress( int lineNumber ) {
- if ( fBlock != null ) {
- IAsmSourceLine[] lines = fBlock.getSourceLines();
- int current = 0;
- for ( int i = 0; i < lines.length; ++i ) {
- IAsmInstruction[] instructions = lines[i].getInstructions();
- if ( fBlock.isMixedMode() ) {
- ++current;
- }
- if ( lineNumber == current && instructions.length > 0 )
- return instructions[0].getAdress();
- if ( lineNumber > current && lineNumber <= current + instructions.length )
- return instructions[lineNumber - current - 1].getAdress();
- current += instructions.length;
- }
- }
- return null;
- }
-
- public String getModuleFile() {
- return ( fBlock != null ) ? fBlock.getModuleFile() : null;
- }
-
- public String getSourceFile() {
- if ( fBlock != null ) {
- Object element = fBlock.getSourceElement();
- if ( element instanceof IFile ) {
- return ((IFile)element).getLocation().toOSString();
- }
- else if ( element instanceof IStorage ) {
- return ((IStorage)element).getFullPath().toOSString();
- }
- }
- return null;
- }
-
- public int getSourceLine( int instrNumber ) {
- if ( fBlock != null ) {
- IAsmSourceLine[] sl = fBlock.getSourceLines();
- int current = 0;
- for ( int i = 0; i < sl.length; ++i ) {
- ++current;
- IAsmInstruction[] ins = sl[i].getInstructions();
- if ( instrNumber >= current && instrNumber <= current + ins.length )
- return sl[i].getLineNumber();
- current += ins.length;
- }
- }
- return -1;
- }
-
- public static DisassemblyEditorInput create( ICStackFrame frame ) throws DebugException {
- DisassemblyEditorInput input = null;
- ICDebugTarget target = ((ICDebugTarget)frame.getDebugTarget());
- IDisassembly disassembly = target.getDisassembly();
- if ( disassembly != null ) {
- IDisassemblyBlock block = disassembly.getDisassemblyBlock( frame );
- input = new DisassemblyEditorInput( block);
- }
- return input;
- }
-
- public static DisassemblyEditorInput create( IDisassemblyBlock block) throws DebugException {
- return new DisassemblyEditorInput(block);
- }
- private void createContents() {
- fSourceRegions = new IRegion[0];
- StringBuffer lines = new StringBuffer();
- int maxFunctionName = 0;
- int maxOpcodeLength = 0;
- long maxOffset = 0;
- if ( fBlock != null ) {
- IAsmSourceLine[] mi = fBlock.getSourceLines();
- for ( int j = 0; j < mi.length; ++j ) {
- IAsmInstruction[] instructions = mi[j].getInstructions();
- for( int i = 0; i < instructions.length; ++i ) {
- String functionName = instructions[i].getFunctionName();
- if ( functionName.length() > maxFunctionName ) {
- maxFunctionName = functionName.length();
- }
- String opcode = instructions[i].getOpcode();
- if ( opcode.length() > maxOpcodeLength )
- maxOpcodeLength = opcode.length();
- long offset = Math.abs( instructions[i].getOffset() );
- if ( offset > maxOffset ) {
- maxOffset = offset;
- }
- }
- }
- int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset );
- int argPosition = instrPos + maxOpcodeLength + 1;
- if ( fBlock.isMixedMode() )
- fSourceRegions = new IRegion[mi.length];
- for ( int j = 0; j < mi.length; ++j ) {
- if ( fBlock.isMixedMode() ) {
- String sl = getSourceLineString( mi[j] );
- fSourceRegions[j] = new Region( lines.length(), sl.length() );
- lines.append( sl );
- }
- IAsmInstruction[] instructions = mi[j].getInstructions();
- for( int i = 0; i < instructions.length; ++i ) {
- lines.append( getInstructionString( instructions[i], instrPos, argPosition ) );
- }
- }
- }
- fContents = lines.toString();
- }
-
- private String getInstructionString( IAsmInstruction instruction, int instrPosition, int argPosition ) {
- int worstCaseSpace = Math.max( instrPosition, argPosition );
- char[] spaces = new char[worstCaseSpace];
- Arrays.fill( spaces, ' ' );
- StringBuffer sb = new StringBuffer();
- if ( instruction != null ) {
- sb.append( instruction.getAdress().toHexAddressString() );
- sb.append( ' ' );
- String functionName = instruction.getFunctionName();
- if ( functionName != null && functionName.length() > 0 ) {
- sb.append( '<' );
- sb.append( functionName );
- long offset = instruction.getOffset();
- if ( offset != 0 ) {
- if ( offset > 0 )
- sb.append( '+' );
- sb.append( instruction.getOffset() );
- }
- sb.append( ">:" ); //$NON-NLS-1$
- sb.append( spaces, 0, instrPosition - sb.length() );
- }
- sb.append( instruction.getOpcode() );
- sb.append( spaces, 0, argPosition - sb.length() );
- sb.append( instruction.getArguments() );
- sb.append( '\n' );
- }
- return sb.toString();
- }
-
- private int calculateInstructionPosition( int maxFunctionName, long maxOffset ) {
- //(Address prefix address representation in chars) + (space) + (<) + (+) + (>) + (:) + (space)
- int addressLength = getDisassembly().getAddressFactory().getMax().getCharsNum();
- return ( addressLength + 6 + maxFunctionName + Long.toString( maxOffset ).length() );
- }
-
- private String getSourceLineString( IAsmSourceLine line ) {
- String text = line.toString();
- if ( text == null ) {
- text = DisassemblyMessages.getString( "DisassemblyEditorInput.source_line_is_not_available_1" ) + '\n'; //$NON-NLS-1$
- }
- return text;
- }
-
- public IRegion[] getSourceRegions() {
- return this.fSourceRegions;
- }
-
- protected IDisassembly getDisassembly() {
- return ( fBlock != null ) ? fBlock.getDisassembly() : null;
- }
-
- /**
- * @return the disassembly block
- */
- public IDisassemblyBlock getDisassemblyBlock() {
- return fBlock;
- }
-
- public ICLineBreakpoint breakpointExists( IAddress address ) throws CoreException {
- Assert.isTrue( address != null );
- IDisassembly dis = getDisassembly();
- if ( dis != null ) {
- ICDebugTarget bt = dis.getDebugTarget().getAdapter( ICDebugTarget.class );
- if ( bt != null ) {
- String modelId = CDIDebugModel.getPluginIdentifier();
- IBreakpoint[] bps = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints( modelId );
- for ( int i = 0; i < bps.length; ++i ) {
- if ( bps[i] instanceof ICLineBreakpoint ) {
- ICLineBreakpoint b = (ICLineBreakpoint)bps[i];
- try {
- IAddress a = bt.getBreakpointAddress( b );
- if ( a != null && address.compareTo( a ) == 0 )
- return b;
- }
- catch( NumberFormatException e ) {
- }
- catch( CoreException e ) {
- }
- }
- }
- }
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMemoryRendering.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMemoryRendering.java
deleted file mode 100644
index 1e9f5176c5..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMemoryRendering.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2015 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.disassembly.rendering;
-
-import org.eclipse.cdt.debug.core.disassembly.IDisassemblyContextProvider;
-import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DisassemblyPane;
-import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.VirtualDocument;
-import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.VirtualSourceViewer;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentPresentation;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.ui.memory.AbstractMemoryRendering;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public class DisassemblyMemoryRendering extends AbstractMemoryRendering {
-
- protected SashForm fSashForm;
- protected DisassemblyPane fDisassemblyPane;
-
- public DisassemblyMemoryRendering( String renderingId ) {
- super( renderingId );
- fDisassemblyPane = new DisassemblyPane( "#DisassemblyRenderingContext", "#DisassemblyRenderingRulerContext" ); //$NON-NLS-1$//$NON-NLS-2$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public Control createControl( Composite parent ) {
- Composite composite = new Composite( parent, SWT.BORDER );
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.verticalSpacing = 0;
- composite.setLayout( layout );
- composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
- createViewer( composite );
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#getControl()
- */
- @Override
- public Control getControl() {
- return fDisassemblyPane.getControl();
- }
-
- protected VirtualSourceViewer getViewer() {
- return fDisassemblyPane.getViewer();
- }
-
- protected void createViewer( final Composite parent ) {
- fSashForm = new SashForm( parent, SWT.VERTICAL );
- fSashForm.setLayoutData( new GridData( GridData.FILL_BOTH ) );
-
- fDisassemblyPane.create( fSashForm );
-
-// createGoToAddressComposite( fSashForm );
-// hideGotoAddressComposite();
-
- IMemoryBlock memoryBlock = getMemoryBlock();
- IDisassemblyContextProvider contextProvider = getDisassemblyContextProvider( memoryBlock );
- Object disassemblyContext = null;
- if ( contextProvider != null ) {
- disassemblyContext = contextProvider.getDisassemblyContext( memoryBlock );
- }
- DisassemblyAnnotationModel annotationModel = new DisassemblyAnnotationModel();
- VirtualDocument document = new VirtualDocument( annotationModel, getDocumentPresentationContext(), disassemblyContext );
- getViewer().setDocument( document );
- document.getContentProvider().changeInput( getViewer(), document.getPresentationContext(), null, getMemoryBlock(), document.getCurrentOffset() );
- }
-
- private IDocumentPresentation getDocumentPresentationContext() {
- return null;
- }
-
- private IDisassemblyContextProvider getDisassemblyContextProvider( Object element ) {
- IDisassemblyContextProvider adapter = null;
- if ( element instanceof IDisassemblyContextProvider ) {
- adapter = (IDisassemblyContextProvider)element;
- }
- else if ( element instanceof IAdaptable ) {
- IAdaptable adaptable = (IAdaptable)element;
- adapter = adaptable.getAdapter( IDisassemblyContextProvider.class );
- }
- return adapter;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMessages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMessages.java
deleted file mode 100644
index 2f57fa0728..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMessages.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.disassembly.rendering;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class DisassemblyMessages {
-
- private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.ui.views.disassembly.DisassemblyMessages"; //$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
-
- private DisassemblyMessages() {
- }
-
- public static String getString( String key ) {
- try {
- return RESOURCE_BUNDLE.getString( key );
- }
- catch( MissingResourceException e ) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMessages.properties
deleted file mode 100644
index e69de29bb2..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyMessages.properties
+++ /dev/null
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyRenderingTypeDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyRenderingTypeDelegate.java
deleted file mode 100644
index fb31d63e89..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/rendering/DisassemblyRenderingTypeDelegate.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.disassembly.rendering;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate;
-
-public class DisassemblyRenderingTypeDelegate implements IMemoryRenderingTypeDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
- */
- @Override
- public IMemoryRendering createRendering( String id ) throws CoreException {
- return new DisassemblyMemoryRendering( id );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementAdapterFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementAdapterFactory.java
deleted file mode 100644
index a1b6e839c1..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementAdapterFactory.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2012 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- * IBM Corporation
- * ARM Limited - https://bugs.eclipse.org/bugs/show_bug.cgi?id=186981
- * Wind River Systems - adapted to work with platform Modules view (bug 210558)
- * Wind River Systems - flexible hierarchy Signals view (bug 338908)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.debug.core.disassembly.IDisassemblyContextProvider;
-import org.eclipse.cdt.debug.core.model.ICDebugElement;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICModule;
-import org.eclipse.cdt.debug.core.model.ICStackFrame;
-import org.eclipse.cdt.debug.core.model.ICThread;
-import org.eclipse.cdt.debug.core.model.IDisassemblyLine;
-import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
-import org.eclipse.cdt.debug.internal.core.CDisassemblyContextProvider;
-import org.eclipse.cdt.debug.internal.core.model.DisassemblyRetrieval;
-import org.eclipse.cdt.debug.internal.ui.sourcelookup.SourceDisplayAdapter;
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleContentProvider;
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleMementoProvider;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentElementAnnotationProvider;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentElementContentProvider;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentElementLabelProvider;
-import org.eclipse.cdt.debug.ui.disassembly.IElementToggleBreakpointAdapter;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider;
-import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
-
-public class CDebugElementAdapterFactory implements IAdapterFactory {
-
- private static IElementContentProvider fgDebugTargetContentProvider = new CDebugTargetContentProvider();
- private static IElementContentProvider fgThreadContentProvider = new CThreadContentProvider();
- private static IElementContentProvider fgStackFrameContentProvider = new CStackFrameContentProvider();
- private static IElementContentProvider fgModuleContentProvider = new ModuleContentProvider();
- private static IElementContentProvider fgCRegisterManagerContentProvider = new CRegisterManagerContentProvider();
-
- private static IModelProxyFactory fgDebugElementProxyFactory = new CDebugElementProxyFactory();
-
- private static IElementMementoProvider fgStackFrameMementoProvider = new CStackFrameMementoProvider();
- private static IElementMementoProvider fgModuleMementoProvider = new ModuleMementoProvider();
-
- private static IDisassemblyContextProvider fgDisassemblyContextProvider = new CDisassemblyContextProvider();
- private static IDocumentElementContentProvider fgDisassemblyContentProvider = new DisassemblyElementContentProvider();
- private static IDocumentElementLabelProvider fgDisassemblyLabelProvider = new DisassemblyElementLabelProvider();
- private static IElementToggleBreakpointAdapter fgDisassemblyToggleBreakpointAdapter = new DisassemblyToggleBreakpointAdapter();
- private static ISourceDisplay fgSourceDisplayAdapter = new SourceDisplayAdapter();
-
- private static IViewerInputProvider fgDefaultViewerInputProvider = new CDefaultViewerInputProvider();
- private static IViewerInputProvider fgStackFrameViewerInputProvider = new CStackFrameViewerInputProvider();
- private static IColumnPresentationFactory fgRegistersViewColumnPresentationFactory = new RegistersViewColumnPresentationFactory();
- private static IColumnPresentationFactory fgDefaultViewColumnPresentationFactory = new DefaultViewColumnPresentationFactory();
- private static IElementMementoProvider fgRegisterManagerProxyMementoProvider = new CRegisterManagerProxyMementoProvider();
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- @SuppressWarnings( "rawtypes" )
- public Object getAdapter( Object adaptableObject, Class adapterType ) {
- if ( adapterType.isInstance( adaptableObject ) ) {
- return adaptableObject;
- }
- if ( adapterType.equals( IElementContentProvider.class ) ) {
- if ( adaptableObject instanceof ICDebugTarget ) {
- return fgDebugTargetContentProvider;
- }
- if ( adaptableObject instanceof ICThread ) {
- return fgThreadContentProvider;
- }
- if ( adaptableObject instanceof ICStackFrame ) {
- return fgStackFrameContentProvider;
- }
- if ( adaptableObject instanceof CRegisterManagerProxy ) {
- return fgCRegisterManagerContentProvider;
- }
- if ( adaptableObject instanceof ICModule ||
- adaptableObject instanceof ICElement ) {
- return fgModuleContentProvider;
- }
- }
- if ( adapterType.equals( IModelProxyFactory.class ) ) {
- if ( adaptableObject instanceof ICDebugTarget ) {
- return fgDebugElementProxyFactory;
- }
- if ( adaptableObject instanceof ICThread ) {
- return fgDebugElementProxyFactory;
- }
- if ( adaptableObject instanceof ICStackFrame ) {
- return fgDebugElementProxyFactory;
- }
- if ( adaptableObject instanceof IModuleRetrieval ) {
- return fgDebugElementProxyFactory;
- }
- if ( adaptableObject instanceof DisassemblyRetrieval ) {
- return fgDebugElementProxyFactory;
- }
- if ( adaptableObject instanceof CRegisterManagerProxy ) {
- return fgDebugElementProxyFactory;
- }
- }
- if ( adapterType.equals( IElementMementoProvider.class ) ) {
- if ( adaptableObject instanceof ICStackFrame ) {
- return fgStackFrameMementoProvider;
- }
- if ( adaptableObject instanceof IModuleRetrieval
- || adaptableObject instanceof ICThread
- || adaptableObject instanceof ICModule
- || adaptableObject instanceof ICElement ) {
- return fgModuleMementoProvider;
- }
- if ( adaptableObject instanceof CRegisterManagerProxy ) {
- return fgRegisterManagerProxyMementoProvider;
- }
- }
- if ( adapterType.equals( IDisassemblyContextProvider.class ) ) {
- if ( adaptableObject instanceof ICStackFrame ) {
- return fgDisassemblyContextProvider;
- }
- }
- if ( adapterType.equals( IDocumentElementContentProvider.class ) ) {
- if ( adaptableObject instanceof ICStackFrame ) {
- return fgDisassemblyContentProvider;
- }
- }
- if ( adapterType.equals( IDocumentElementLabelProvider.class ) ) {
- if ( adaptableObject instanceof IDisassemblyLine ) {
- return fgDisassemblyLabelProvider;
- }
- }
- if ( adapterType.equals( IElementToggleBreakpointAdapter.class ) ) {
- if ( adaptableObject instanceof IDisassemblyLine ) {
- return fgDisassemblyToggleBreakpointAdapter;
- }
- }
- if ( adapterType.equals( ISourceDisplay.class ) ) {
- if ( adaptableObject instanceof ICStackFrame ) {
- return fgSourceDisplayAdapter;
- }
- }
- if ( adapterType.equals( IViewerInputProvider.class ) ) {
- if ( adaptableObject instanceof ICDebugTarget
- || adaptableObject instanceof ICThread )
- return fgDefaultViewerInputProvider;
- if ( adaptableObject instanceof ICStackFrame ) {
- return fgStackFrameViewerInputProvider;
- }
- }
- if ( adapterType.equals( IColumnPresentationFactory.class ) ) {
- if ( adaptableObject instanceof CRegisterManagerProxy ) {
- return fgRegistersViewColumnPresentationFactory;
- } else if (adaptableObject instanceof ICDebugElement) {
- return fgDefaultViewColumnPresentationFactory;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- @SuppressWarnings( "rawtypes" )
- public Class[] getAdapterList() {
- return new Class[] {
- IElementContentProvider.class,
- IModelProxyFactory.class,
- IElementMementoProvider.class,
- IDisassemblyContextProvider.class,
- IDocumentElementContentProvider.class,
- IDocumentElementLabelProvider.class,
- IDocumentElementAnnotationProvider.class,
- IElementToggleBreakpointAdapter.class,
- ISourceDisplay.class,
- IViewerInputProvider.class,
- };
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementLabelProviderFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementLabelProviderFactory.java
deleted file mode 100644
index abcb6f5511..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementLabelProviderFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- * Wind River Systems - flexible hierarchy Signals view (bug 338908)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.debug.core.model.ICModule;
-import org.eclipse.cdt.debug.core.model.ICSignal;
-import org.eclipse.cdt.debug.core.model.ICVariable;
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleLabelProvider;
-import org.eclipse.cdt.debug.internal.ui.views.signals.SignalLabelProvider;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
-
-/**
- * Factory for all (non-default) label providers
- */
-public class CDebugElementLabelProviderFactory implements IAdapterFactory {
-
- private static IElementLabelProvider fgModuleLabelProvider = new ModuleLabelProvider();
- private static IElementLabelProvider fgVariableLabelProvider = new CVariableLabelProvider();
- private static IElementLabelProvider fgSignalLabelProvider = new SignalLabelProvider();
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- @SuppressWarnings("rawtypes")
- public Object getAdapter( Object adaptableObject, Class adapterType ) {
- if ( adapterType.equals( IElementLabelProvider.class ) ) {
- if ( adaptableObject instanceof ICModule ) {
- return fgModuleLabelProvider;
- }
- if ( adaptableObject instanceof ICElement ) {
- return fgModuleLabelProvider;
- }
- if ( adaptableObject instanceof ICVariable ) {
- return fgVariableLabelProvider;
- }
- if ( adaptableObject instanceof ICSignal ) {
- return fgSignalLabelProvider;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- @SuppressWarnings("rawtypes")
- public Class[] getAdapterList() {
- return new Class[] {
- IElementLabelProvider.class,
- };
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementProxyFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementProxyFactory.java
deleted file mode 100644
index 4159cfe439..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugElementProxyFactory.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2015 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- * IBM Corporation
- * Wind River Systems - adapted to work with platform Modules view (bug 210558)
- * Wind River Systems - flexible hierarchy Signals view (bug 338908)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
-import org.eclipse.cdt.debug.internal.core.model.DisassemblyRetrieval;
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModulesViewModelProxy;
-import org.eclipse.cdt.debug.internal.ui.views.signals.SignalsViewModelProxy;
-import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.update.DefaultModelProxyFactory;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class CDebugElementProxyFactory extends DefaultModelProxyFactory {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelProxyFactoryAdapter#createModelProxy(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- @Override
- public IModelProxy createModelProxy( Object element, IPresentationContext context ) {
- if ( IDebugUIConstants.ID_MODULE_VIEW.equals( context.getId() ) ) {
- IModuleRetrieval mr = null;
- if ( element instanceof IAdaptable ) {
- ICDebugTarget target = ((IAdaptable)element).getAdapter( ICDebugTarget.class );
- if ( target != null )
- mr = target.getAdapter( IModuleRetrieval.class );
- }
- if ( mr != null ) {
- return new ModulesViewModelProxy( mr );
- }
- }
- else if ( IDebugUIConstants.ID_REGISTER_VIEW.equals( context.getId() ) ) {
- if ( element instanceof CRegisterManagerProxy ) {
- return new CRegisterManagerModelProxy( (CRegisterManagerProxy)element );
- }
- }
- else if ( ICDebugUIConstants.ID_DEFAULT_DISASSEMBLY_EDITOR.equals( context.getId() ) ) {
- if ( element instanceof DisassemblyRetrieval ) {
- return new DisassemblyElementProxy( element );
- }
- }
- else if ( ICDebugUIConstants.ID_SIGNALS_VIEW.equals( context.getId() ) ) {
- if ( element instanceof ICDebugTarget ) {
- return new SignalsViewModelProxy( element );
- }
- }
- return super.createModelProxy( element, context );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugTargetContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugTargetContentProvider.java
deleted file mode 100644
index b631dd2bf4..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDebugTargetContentProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 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
- * Wind River Systems - flexible hierarchy Signals view (bug 338908)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleContentProvider;
-import org.eclipse.cdt.debug.internal.ui.views.signals.SignalsContentProvider;
-import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
-import org.eclipse.debug.internal.ui.model.elements.DebugTargetContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Delegating provider implementation. If the memento request is for the
- * modules view, the provider impelementation delegates the request to the
- * modules view-specific provider. Otherwise, it calls the default superclass
- * implementation.
- */
-public class CDebugTargetContentProvider extends DebugTargetContentProvider {
- private final ModuleContentProvider fModuleContentProvider = new ModuleContentProvider();
- private final SignalsContentProvider fSignalsContentProvider = new SignalsContentProvider();
-
- @Override
- public void update(IChildrenCountUpdate[] updates) {
- String id = updates[0].getPresentationContext().getId();
- if (IDebugUIConstants.ID_MODULE_VIEW.equals(id)) {
- fModuleContentProvider.update(updates);
- } else if (ICDebugUIConstants.ID_SIGNALS_VIEW.equals(id)) {
- fSignalsContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-
- @Override
- public void update(IHasChildrenUpdate[] updates) {
- String id = updates[0].getPresentationContext().getId();
- if (IDebugUIConstants.ID_MODULE_VIEW.equals(id)) {
- fModuleContentProvider.update(updates);
- } else if (ICDebugUIConstants.ID_SIGNALS_VIEW.equals(id)) {
- fSignalsContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-
- @Override
- public void update(IChildrenUpdate[] updates) {
- String id = updates[0].getPresentationContext().getId();
- if (IDebugUIConstants.ID_MODULE_VIEW.equals(id)) {
- fModuleContentProvider.update(updates);
- } else if (ICDebugUIConstants.ID_SIGNALS_VIEW.equals(id)) {
- fSignalsContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDefaultViewerInputProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDefaultViewerInputProvider.java
deleted file mode 100644
index 607565b39a..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CDefaultViewerInputProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- * Wind River Systems - flexible hierarchy Signals view (bug 338908)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.ICDebugElement;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.internal.ui.CRegisterManagerProxies;
-import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.elements.adapters.DefaultViewerInputProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class CDefaultViewerInputProvider extends DefaultViewerInputProvider implements IViewerInputProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#getViewerInput(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- @Override
- protected Object getViewerInput( Object source, IPresentationContext context, IViewerUpdate update ) throws CoreException {
- if ( IDebugUIConstants.ID_REGISTER_VIEW.equals( context.getId() ) && source instanceof ICDebugElement ) {
- ICDebugTarget target = (ICDebugTarget)((ICDebugElement)source).getDebugTarget();
- return CRegisterManagerProxies.getInstance().getRegisterManagerProxy( target );
- }
- if ( ICDebugUIConstants.ID_SIGNALS_VIEW.equals( context.getId() ) && source instanceof ICDebugElement ) {
- ICDebugTarget target = (ICDebugTarget)((ICDebugElement)source).getDebugTarget();
- return target;
- }
- return super.getViewerInput( source, context, update );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.elements.adapters.DefaultViewerInputProvider#supportsContextId(java.lang.String)
- */
- @Override
- protected boolean supportsContextId( String id ) {
- if ( IDebugUIConstants.ID_REGISTER_VIEW.equals( id ) )
- return true;
- if ( ICDebugUIConstants.ID_SIGNALS_VIEW.equals( id ) )
- return true;
- return super.supportsContextId( id );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerContentProvider.java
deleted file mode 100644
index 4c80af8dcd..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerContentProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class CRegisterManagerContentProvider extends ElementContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- @Override
- protected Object[] getChildren( Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor ) throws CoreException {
- return getElements( getRegisterGroups( (CRegisterManagerProxy)parent ), index, length );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- @Override
- protected int getChildCount( Object element, IPresentationContext context, IViewerUpdate monitor ) throws CoreException {
- return getRegisterGroups( (CRegisterManagerProxy)element ).length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- @Override
- protected boolean supportsContextId( String id ) {
- return IDebugUIConstants.ID_REGISTER_VIEW.equals( id );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- @Override
- protected boolean hasChildren( Object element, IPresentationContext context, IViewerUpdate monitor ) throws CoreException {
- return getRegisterGroups( (CRegisterManagerProxy)element ).length > 0;
- }
-
- private IRegisterGroup[] getRegisterGroups( CRegisterManagerProxy rmp ) {
- return rmp.getRegisterGroups();
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerModelProxy.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerModelProxy.java
deleted file mode 100644
index 88aaa6cd47..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerModelProxy.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-import org.eclipse.jface.viewers.Viewer;
-
-public class CRegisterManagerModelProxy extends AbstractModelProxy {
-
- private CRegisterManagerProxy fRegisterManagerProxy;
-
- public CRegisterManagerModelProxy( CRegisterManagerProxy rmp ) {
- super();
- fRegisterManagerProxy = rmp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
- */
- @Override
- public void installed( Viewer viewer ) {
- fRegisterManagerProxy.setModelProxy( this );
- super.installed( viewer );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
- */
- @Override
- public synchronized void dispose() {
- fRegisterManagerProxy.setModelProxy( null );
- fRegisterManagerProxy = null;
- super.dispose();
- }
-
- public void update() {
- ModelDelta delta = new ModelDelta( fRegisterManagerProxy, IModelDelta.CONTENT );
- fireModelChanged( delta );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerProxy.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerProxy.java
deleted file mode 100644
index 637236b738..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerProxy.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.ICDebugElement;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICStackFrame;
-import org.eclipse.cdt.debug.core.model.ICThread;
-import org.eclipse.cdt.debug.core.model.ICVariable;
-import org.eclipse.cdt.debug.internal.core.CRegisterManager;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IRegister;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Acts as a viewer input for the Registers view
- */
-public class CRegisterManagerProxy implements IDebugEventSetListener, IDebugContextListener {
-
- private CRegisterManager fRegisterManager;
- private ICDebugElement fContext;
- private CRegisterManagerModelProxy fModelProxy;
-
- public CRegisterManagerProxy( CRegisterManager registerManager ) {
- super();
- fRegisterManager = registerManager;
- }
-
- public void dispose() {
- fRegisterManager = null;
- fContext = null;
- fModelProxy = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
- */
- @Override
- public void debugContextChanged( DebugContextEvent event ) {
- ICDebugElement context = null;
- ISelection s = event.getContext();
- if ( s instanceof IStructuredSelection ) {
- IStructuredSelection selection = (IStructuredSelection)s;
- context =
- ( selection.size() == 1 ) ?
- ( selection.getFirstElement() instanceof ICDebugElement ) ?
- (ICDebugElement)selection.getFirstElement() : null
- : null;
- }
- setContext( context );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- @Override
- public void handleDebugEvents( DebugEvent[] events ) {
- CRegisterManagerModelProxy modelProxy = getModelProxy();
- for( int i = 0; i < events.length; i++ ) {
- DebugEvent event = events[i];
- if ( !containsEvent( event ) )
- continue;
- Object source = event.getSource();
- if ( source instanceof ICDebugTarget
- && (( event.getKind() == DebugEvent.SUSPEND )
- || event.getKind() == DebugEvent.TERMINATE ) ) {
- if ( modelProxy != null )
- modelProxy.update();
- }
- else if ( source instanceof ICDebugTarget
- && (( event.getKind() == DebugEvent.CHANGE )
- && event.getDetail() == DebugEvent.CONTENT ) ) {
- if ( modelProxy != null )
- modelProxy.update();
- }
- else if ( source instanceof IRegisterGroup
- && event.getKind() == DebugEvent.CHANGE ) {
- if ( modelProxy != null )
- modelProxy.update();
- }
- else if ( source instanceof IRegister
- && event.getKind() == DebugEvent.CHANGE ) {
- if ( modelProxy != null )
- modelProxy.update();
- }
- else if ( source instanceof ICVariable
- && event.getKind() == DebugEvent.CHANGE ) {
- if ( modelProxy != null )
- modelProxy.update();
- }
- else if ( source instanceof ICThread
- && event.getKind() == DebugEvent.SUSPEND ) {
- if ( modelProxy != null )
- modelProxy.update();
- }
- }
- }
-
- public IRegisterGroup[] getRegisterGroups() {
- return fRegisterManager.getRegisterGroups();
- }
-
- public void setModelProxy( CRegisterManagerModelProxy modelProxy ) {
- fModelProxy = modelProxy;
- }
-
- public CRegisterManagerModelProxy getModelProxy() {
- return fModelProxy;
- }
-
- public String getModelIdentifier() {
- return fRegisterManager.getDebugTarget().getModelIdentifier();
- }
-
- public void setContext( ICDebugElement context ) {
- if ( fContext == null || !fContext.equals( context ) ) {
- fContext = context;
- try {
- fRegisterManager.setCurrentFrame( ( fContext instanceof ICStackFrame ) ? (ICStackFrame)context : null );
- }
- catch( DebugException e ) {
- // TODO: should we pass the error up?
- }
- CRegisterManagerModelProxy modelProxy = getModelProxy();
- if ( modelProxy != null )
- modelProxy.update();
- }
- }
-
- private boolean containsEvent( DebugEvent event ) {
- Object source = event.getSource();
- if ( source instanceof ICDebugElement ) {
- return fRegisterManager.getDebugTarget().equals( ((ICDebugElement)source).getDebugTarget() );
- }
- return false;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerProxyMementoProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerProxyMementoProvider.java
deleted file mode 100644
index e14f096be7..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CRegisterManagerProxyMementoProvider.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class CRegisterManagerProxyMementoProvider extends DebugElementMementoProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- @Override
- protected String getElementName( Object element, IPresentationContext context ) throws CoreException {
- if ( element instanceof CRegisterManagerProxy ) {
- if ( IDebugUIConstants.ID_REGISTER_VIEW.equals( context.getId() ) ) {
- return ((CRegisterManagerProxy)element).getModelIdentifier();
- }
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameContentProvider.java
deleted file mode 100644
index 854f75fcef..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameContentProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * 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.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Delegating provider implementation. If the memento request is for the
- * modules view, the provider impelementation delegates the request to the
- * modules view-specific provider. Otherwise, it calls the default superclass
- * implementation.
- */
-public class CStackFrameContentProvider extends StackFrameContentProvider {
- private ModuleContentProvider fModuleContentProvider = new ModuleContentProvider();
-
- @Override
- public void update(IChildrenCountUpdate[] updates) {
- if (updates[0].getPresentationContext().getId().equals(IDebugUIConstants.ID_MODULE_VIEW)) {
- fModuleContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-
- @Override
- public void update(IHasChildrenUpdate[] updates) {
- if (updates[0].getPresentationContext().getId().equals(IDebugUIConstants.ID_MODULE_VIEW)) {
- fModuleContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-
- @Override
- public void update(IChildrenUpdate[] updates) {
- if (updates[0].getPresentationContext().getId().equals(IDebugUIConstants.ID_MODULE_VIEW)) {
- fModuleContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameMementoProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameMementoProvider.java
deleted file mode 100644
index 8001b7e5c4..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameMementoProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * 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.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.StackFrameMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Delegating provider implementation. If the memento request is for the
- * modules view, the provider impelementation delegates the request to the
- * modules view-specific provider. Otherwise, it calls the default superclass
- * implementation.
- */
-public class CStackFrameMementoProvider extends StackFrameMementoProvider {
- private ModuleMementoProvider fModuleMementoProvider = new ModuleMementoProvider();
-
- @Override
- public void encodeElements(IElementMementoRequest[] requests) {
- if (requests[0].getPresentationContext().getId().equals(IDebugUIConstants.ID_MODULE_VIEW)) {
- fModuleMementoProvider.encodeElements(requests);
- } else {
- super.encodeElements(requests);
- }
- }
-
-
- @Override
- public void compareElements(IElementCompareRequest[] requests) {
- if (requests[0].getPresentationContext().getId().equals(IDebugUIConstants.ID_MODULE_VIEW)) {
- fModuleMementoProvider.compareElements(requests);
- } else {
- super.compareElements(requests);
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameViewerInputProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameViewerInputProvider.java
deleted file mode 100644
index 78b194ce45..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CStackFrameViewerInputProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- * Wind River Systems - flexible hierarchy Signals view (bug 338908)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.ICDebugElement;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICStackFrame;
-import org.eclipse.cdt.debug.internal.ui.CRegisterManagerProxies;
-import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.elements.adapters.StackFrameViewerInputProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class CStackFrameViewerInputProvider extends StackFrameViewerInputProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.elements.adapters.StackFrameViewerInputProvider#getViewerInput(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- @Override
- protected Object getViewerInput( Object source, IPresentationContext context, IViewerUpdate update ) throws CoreException {
- if ( IDebugUIConstants.ID_REGISTER_VIEW.equals( context.getId() ) && source instanceof ICStackFrame ) {
- ICDebugTarget target = (ICDebugTarget)((ICStackFrame)source).getDebugTarget();
- return CRegisterManagerProxies.getInstance().getRegisterManagerProxy( target );
- }
- if ( ICDebugUIConstants.ID_SIGNALS_VIEW.equals( context.getId() ) && source instanceof ICDebugElement ) {
- ICDebugTarget target = (ICDebugTarget)((ICDebugElement)source).getDebugTarget();
- return target;
- }
- return super.getViewerInput( source, context, update );
- }
-
- @Override
- protected boolean supportsContextId(String id) {
- if ( ICDebugUIConstants.ID_SIGNALS_VIEW.equals( id ) )
- return true;
- return super.supportsContextId(id);
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CThreadContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CThreadContentProvider.java
deleted file mode 100644
index 4cba075539..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CThreadContentProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * 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.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.internal.ui.views.modules.ModuleContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.ThreadContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Delegating provider implementation. If the memento request is for the
- * modules view, the provider impelementation delegates the request to the
- * modules view-specific provider. Otherwise, it calls the default superclass
- * implementation.
- */
-public class CThreadContentProvider extends ThreadContentProvider {
- private ModuleContentProvider fModuleContentProvider = new ModuleContentProvider();
-
- @Override
- public void update(IChildrenCountUpdate[] updates) {
- if (updates[0].getPresentationContext().getId().equals(IDebugUIConstants.ID_MODULE_VIEW)) {
- fModuleContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-
- @Override
- public void update(IHasChildrenUpdate[] updates) {
- if (updates[0].getPresentationContext().getId().equals(IDebugUIConstants.ID_MODULE_VIEW)) {
- fModuleContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-
- @Override
- public void update(IChildrenUpdate[] updates) {
- if (updates[0].getPresentationContext().getId().equals(IDebugUIConstants.ID_MODULE_VIEW)) {
- fModuleContentProvider.update(updates);
- } else {
- super.update(updates);
- }
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CVariableLabelProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CVariableLabelProvider.java
deleted file mode 100644
index af052b5dc6..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CVariableLabelProvider.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.ICValue;
-import org.eclipse.cdt.debug.core.model.ICVariable;
-import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation;
-import org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Label provider for variables and registers.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=186981
- *
- * Using the internal platform classes because the API hasn't been defined.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=187500 and
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=187502
- */
-public class CVariableLabelProvider extends DebugElementLabelProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- @Override
- protected String getLabel( TreePath elementPath, IPresentationContext context, String columnId ) throws CoreException {
- if ( columnId != null ) {
- IVariable variable = (IVariable)elementPath.getLastSegment();
- IValue value = variable.getValue();
- return getColumnText( variable, value, context, columnId );
- }
- return super.getLabel( elementPath, context, columnId );
- }
-
- protected String getValueText( IVariable variable, IValue value, IPresentationContext context ) throws CoreException {
- if ( value instanceof ICValue ) {
- return CDebugUIUtils.getValueText( value );
- }
- return null;
- }
-
- protected String getVariableTypeName( IVariable variable, IPresentationContext context ) throws CoreException {
- if ( variable instanceof ICVariable ) {
- return CDebugUIUtils.getVariableTypeName( ((ICVariable)variable).getType() );
- }
- return null;
- }
-
- protected String getVariableName( IVariable variable, IPresentationContext context ) throws CoreException {
- return CDebugUIUtils.getVariableName( variable );
- }
-
- protected String getColumnText( IVariable variable, IValue value, IPresentationContext context, String columnId ) throws CoreException {
- if ( VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals( columnId ) ) {
- return getVariableName( variable, context );
- }
- else if ( VariableColumnPresentation.COLUMN_VARIABLE_TYPE.equals( columnId ) ) {
- return getVariableTypeName( variable, context );
- }
- else if ( VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals( columnId ) ) {
- return getValueText( variable, value, context );
- }
- return null; // super.getColumnText( variable, value, context, columnId );
- }
-
- @Override
- protected ImageDescriptor getImageDescriptor( TreePath elementPath, IPresentationContext presentationContext, String columnId ) throws CoreException {
- if ( columnId == null || VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals( columnId ) ) {
- return super.getImageDescriptor( elementPath, presentationContext, columnId );
- }
- return null; // super.getImageDescriptor( elementPath, presentationContext, columnId );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getBackground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- @Override
- protected RGB getBackground( TreePath elementPath, IPresentationContext presentationContext, String columnId ) throws CoreException {
- Object element = elementPath.getLastSegment();
- if ( columnId != null ) {
- if ( element instanceof IVariable ) {
- IVariable variable = (IVariable)element;
- if ( variable.hasValueChanged() ) {
- // No public access to the changed value background color of the Variables view. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=187509
- return DebugUITools.getPreferenceColor( IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND ).getRGB();
- }
- }
- }
- return super.getBackground( elementPath, presentationContext, columnId );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getFontData(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- @Override
- protected FontData getFontData( TreePath elementPath, IPresentationContext presentationContext, String columnId ) throws CoreException {
- // No public access to the Variables view text font id. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=187509
- return JFaceResources.getFontDescriptor( IDebugUIConstants.PREF_VARIABLE_TEXT_FONT ).getFontData()[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getForeground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- @Override
- protected RGB getForeground( TreePath elementPath, IPresentationContext presentationContext, String columnId ) throws CoreException {
- Object element = elementPath.getLastSegment();
- if ( columnId == null ) {
- if ( element instanceof IVariable ) {
- IVariable variable = (IVariable)element;
- if ( variable.hasValueChanged() ) {
- return DebugUITools.getPreferenceColor( IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR ).getRGB();
- }
- }
- }
- return super.getForeground( elementPath, presentationContext, columnId );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CWatchExpressionFactoryAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CWatchExpressionFactoryAdapter.java
deleted file mode 100644
index 753491ade1..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CWatchExpressionFactoryAdapter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 ARM 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:
- * ARM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.ICVariable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapterExtension;
-
-public class CWatchExpressionFactoryAdapter implements IWatchExpressionFactoryAdapterExtension {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapterExtension#canCreateWatchExpression(org.eclipse.debug.core.model.IVariable)
- */
- @Override
- public boolean canCreateWatchExpression( IVariable variable ) {
- return ( variable instanceof ICVariable );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter#createWatchExpression(org.eclipse.debug.core.model.IVariable)
- */
- @Override
- public String createWatchExpression( IVariable variable ) throws CoreException {
- return ( variable instanceof ICVariable ) ? ((ICVariable)variable).getExpressionString() : null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CWatchExpressionFactoryAdapterFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CWatchExpressionFactoryAdapterFactory.java
deleted file mode 100644
index 1c143f6608..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/CWatchExpressionFactoryAdapterFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 ARM 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:
- * ARM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.ICVariable;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter;
-
-public class CWatchExpressionFactoryAdapterFactory implements IAdapterFactory {
-
- private static IWatchExpressionFactoryAdapter fgWatchExpressionFactoryAdapter = new CWatchExpressionFactoryAdapter();
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- @Override
- public Object getAdapter( Object adaptableObject, Class adapterType ) {
- if ( adapterType.equals( IWatchExpressionFactoryAdapter.class ) ) {
- if ( adaptableObject instanceof ICVariable ) {
- return fgWatchExpressionFactoryAdapter;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return new Class[] {
- IWatchExpressionFactoryAdapter.class,
- };
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DefaultViewColumnPresentationFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DefaultViewColumnPresentationFactory.java
deleted file mode 100644
index 05c9f615a3..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DefaultViewColumnPresentationFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- * Wind River Systems - flexible hierarchy Signals view (bug 338908)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.internal.ui.views.signals.SignalsViewColumnPresentation;
-import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-public class DefaultViewColumnPresentationFactory implements IColumnPresentationFactory {
-
- @Override
- public IColumnPresentation createColumnPresentation( IPresentationContext context, Object element ) {
- if ( context.getId().equals( ICDebugUIConstants.ID_SIGNALS_VIEW ) )
- return new SignalsViewColumnPresentation();
- return null;
- }
-
- @Override
- public String getColumnPresentationId( IPresentationContext context, Object element ) {
- if ( context.getId().equals( ICDebugUIConstants.ID_SIGNALS_VIEW ) )
- return SignalsViewColumnPresentation.ID;
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementContentProvider.java
deleted file mode 100644
index 0f69629ef5..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementContentProvider.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.IDisassemblyLine;
-import org.eclipse.cdt.debug.internal.core.model.DisassemblyRetrieval;
-import org.eclipse.cdt.debug.internal.ui.disassembly.editor.DisassemblyEditorPresentation;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentBaseChangeUpdate;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentElementContentProvider;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentElementContentUpdate;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentPresentation;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-
-public class DisassemblyElementContentProvider implements IDocumentElementContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.ui.disassembly.IDocumentElementContentProvider#updateContent(org.eclipse.cdt.debug.ui.disassembly.IDocumentElementContentUpdate)
- */
- @Override
- public void updateContent( final IDocumentElementContentUpdate update ) {
- Job job = new Job( "Source content update" ) { //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected IStatus run( IProgressMonitor monitor ) {
- if ( !update.isCanceled() ) {
- retrieveDisassembly( update );
- }
- update.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem( true );
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.ui.disassembly.IDocumentElementContentProvider#updateInput(org.eclipse.cdt.debug.ui.disassembly.IDocumentBaseChangeUpdate)
- */
- @Override
- public void updateInput( final IDocumentBaseChangeUpdate update ) {
- Job job = new Job( "Input update" ) { //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected IStatus run( IProgressMonitor monitor ) {
- if ( !update.isCanceled() ) {
- changeBaseElement( update );
- }
- update.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem( true );
- job.schedule();
- }
-
- protected void changeBaseElement( IDocumentBaseChangeUpdate update ) {
- Object root = update.getRootElement();
- if ( root instanceof DisassemblyRetrieval ) {
- DisassemblyRetrieval retrieval = (DisassemblyRetrieval)root;
- try {
- retrieval.changeBase( update.getElement(), update.getOriginalOffset(), getPresentationFlags( (IDocumentPresentation)update.getPresentationContext() ) );
- update.setBaseElement( retrieval.getBaseElement() );
- update.setOffset( retrieval.getCurrentOffset() );
- }
- catch( DebugException e ) {
- update.setStatus( e.getStatus() );
- }
- }
- }
-
- protected void retrieveDisassembly( IDocumentElementContentUpdate update ) {
- Object root = update.getRootElement();
- if ( root instanceof DisassemblyRetrieval ) {
- DisassemblyRetrieval retrieval = (DisassemblyRetrieval)root;
- try {
- retrieval.retrieveDisassembly(
- update.getElement(),
- update.getBaseElement(),
- update.getOriginalOffset(),
- update.getRequestedLineCount(),
- update.reveal(),
- getPresentationFlags( (IDocumentPresentation)update.getPresentationContext() ) );
- IDisassemblyLine[] lines = retrieval.getLines();
- update.setOffset( retrieval.getCurrentOffset() );
- update.setLineCount( lines.length );
- for( int i = 0; i < lines.length; ++i ) {
- update.addElement( i, lines[i] );
- }
- }
- catch( DebugException e ) {
- update.setStatus( e.getStatus() );
- }
- }
- }
-
- private int getPresentationFlags( IDocumentPresentation presentation ) {
- int flags = 0;
- if ( presentation instanceof DisassemblyEditorPresentation ) {
- DisassemblyEditorPresentation dep = (DisassemblyEditorPresentation)presentation;
- if ( dep.showIntstructions() )
- flags |= DisassemblyRetrieval.FLAGS_SHOW_INSTRUCTIONS;
- if ( dep.showSource() )
- flags |= DisassemblyRetrieval.FLAGS_SHOW_SOURCE;
- }
- return flags;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementLabelProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementLabelProvider.java
deleted file mode 100644
index 44b9580bc8..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementLabelProvider.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- * IBM Corporation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.math.BigInteger;
-import com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.cdt.debug.core.CDebugUtils;
-import org.eclipse.cdt.debug.core.model.IDisassemblyInstruction;
-import org.eclipse.cdt.debug.core.model.IDisassemblySourceLine;
-import org.eclipse.cdt.debug.internal.ui.disassembly.editor.DisassemblyEditorPresentation;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentElementLabelProvider;
-import org.eclipse.cdt.debug.ui.disassembly.IDocumentElementLabelUpdate;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * org.eclipse.cdt.debug.internal.ui.elements.adapters.DisassemblyElementLabelProvider:
- * //TODO Add description.
- */
-public class DisassemblyElementLabelProvider implements IDocumentElementLabelProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.ui.disassembly.IDocumentElementLabelProvider#update(org.eclipse.cdt.debug.ui.disassembly.IDocumentElementLabelUpdate[])
- */
- @Override
- public void update( final IDocumentElementLabelUpdate[] updates ) {
- Job job = new Job( "Label update" ) { //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected IStatus run( IProgressMonitor monitor ) {
- for( int i = 0; i < updates.length; i++ ) {
- IDocumentElementLabelUpdate update = updates[i];
- if ( !update.isCanceled() ) {
- retrieveLabel( update );
- }
- update.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem( true );
- job.schedule();
- }
-
- protected void retrieveLabel( IDocumentElementLabelUpdate update ) {
- IPresentationContext context = update.getPresentationContext();
- if ( context instanceof DisassemblyEditorPresentation ) {
- DisassemblyEditorPresentation presentation = (DisassemblyEditorPresentation)context;
- Object element = update.getElement();
- if ( element instanceof IDisassemblyInstruction ) {
- IDisassemblyInstruction instruction = (IDisassemblyInstruction)element;
- StringBuilder sb = new StringBuilder();
- if ( presentation.showAddresses() ) {
- BigInteger address = instruction.getAdress().getValue();
- sb.append( "0x" ); //$NON-NLS-1$
- sb.append( CDebugUtils.prependString( Long.toHexString( address.longValue() ), 8, '0' ) );
- sb.append( '\t' );
- }
- sb.append( instruction.getInstructionText() );
- update.setLabel( DisassemblyEditorPresentation.ATTR_LINE_LABEL, sb.toString() );
- }
- else if ( element instanceof IDisassemblySourceLine ) {
- IDisassemblySourceLine line = (IDisassemblySourceLine)element;
- StringBuilder sb = new StringBuilder();
- if ( presentation.showLineNumbers() ) {
- sb.append( line.getLineNumber() );
- sb.append( '\t' );
- }
- sb.append( getSourceLineText( line ) );
- update.setLabel( DisassemblyEditorPresentation.ATTR_LINE_LABEL, sb.toString() );
- }
- }
- }
-
- private String getSourceLineText( IDisassemblySourceLine line ) {
- File file = line.getFile();
- String text = MessageFormat.format( "File {0} not found.", new Object[] {file.getPath()} );
- ISourceLocator locator = line.getDebugTarget().getLaunch().getSourceLocator();
- if ( locator instanceof ISourceLookupDirector ) {
- ISourceLookupDirector director = (ISourceLookupDirector)locator;
- Object sourceElement = director.getSourceElement( file.getPath() );
- if ( sourceElement != null ) {
- File lookupFile = null;
- if ( sourceElement instanceof IFile ) {
- lookupFile = ((IFile)sourceElement).getLocation().toFile();
- }
- else if ( sourceElement instanceof IStorage ) {
- lookupFile = ((IStorage)sourceElement).getFullPath().toFile();
- }
- if ( lookupFile != null ) {
- try {
- text = readLine( lookupFile, line.getLineNumber() - 1 );
- }
- catch( IOException e ) {
- text = e.getLocalizedMessage();
- }
- }
- }
- }
- return text;
- }
-
- private String readLine( File file, int lineNumber ) throws IOException {
- FileReader fr = new FileReader( file );
- BufferedReader br = new BufferedReader( fr );
-
- try {
- int count = 0;
- String result = null;
- do {
- result = br.readLine();
- if ( count++ == lineNumber )
- return result;
- }
- while( result != null );
- }
- finally {
- br.close();
- }
-
- throw new IOException( MessageFormat.format( "Line {0} doesn't exist in {1}.", new Object[] {Integer.valueOf( lineNumber ), file.getPath()}) );
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementProxy.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementProxy.java
deleted file mode 100644
index fd3335bc18..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyElementProxy.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.core.model.IDisassemblyLine;
-import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
-import org.eclipse.cdt.debug.internal.core.model.DisassemblyRetrieval;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * org.eclipse.cdt.debug.internal.ui.elements.adapters.DisassemblyElementProxy:
- * //TODO Add description.
- */
-public class DisassemblyElementProxy extends AbstractModelProxy implements IDebugEventSetListener {
-
- private Object fElement;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public DisassemblyElementProxy( Object element ) {
- super();
- fElement = element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
- */
- @Override
- public void installed( Viewer viewer ) {
- super.installed( viewer );
- DebugPlugin.getDefault().addDebugEventListener( this );
- fireModelChanged( new ModelDelta( fElement, IModelDelta.CONTENT ) );
- }
-
- @Override
- public void handleDebugEvents( DebugEvent[] events ) {
- for ( DebugEvent event : events ) {
- Object source = event.getSource();
- int kind = event.getKind();
- int detail = event.getDetail();
- if ( source instanceof IDisassemblyLine ) {
- if ( kind == DebugEvent.CHANGE && detail == DebugEvent.STATE ) {
- IDisassemblyLine line = (IDisassemblyLine)source;
- DisassemblyRetrieval dr = ((CDebugTarget)line.getDebugTarget()).getDisassemblyRetrieval();
- if ( getElement().equals( dr ) ) {
- fireModelChanged( createDelta( line ) );
- }
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#dispose()
- */
- @Override
- public synchronized void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener( this );
- super.dispose();
- }
-
- protected Object getElement() {
- return fElement;
- }
-
- protected IModelDelta createDelta( IDisassemblyLine line ) {
- DisassemblyRetrieval dr = ((CDebugTarget)line.getDebugTarget()).getDisassemblyRetrieval();
- ModelDelta delta = new ModelDelta( dr, IModelDelta.NO_CHANGE );
- delta.addNode( line, IModelDelta.STATE );
- return delta;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyToggleBreakpointAdapter.java
deleted file mode 100644
index a41e7983e1..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/DisassemblyToggleBreakpointAdapter.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 ARM Limited 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:
- * ARM Limited - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import java.math.BigInteger;
-
-import org.eclipse.cdt.core.IAddress;
-import org.eclipse.cdt.debug.core.CDIDebugModel;
-import org.eclipse.cdt.debug.core.model.ICBreakpointType;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
-import org.eclipse.cdt.debug.core.model.IDisassemblyInstruction;
-import org.eclipse.cdt.debug.ui.disassembly.IElementToggleBreakpointAdapter;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * org.eclipse.cdt.debug.internal.ui.elements.adapters.DisassemblyToggleBreakpointAdapter:
- * //TODO Add description.
- */
-public class DisassemblyToggleBreakpointAdapter implements IElementToggleBreakpointAdapter {
-
-
- /* (non-Javadoc)
- * @see com.arm.eclipse.rvd.ui.disassembly.IElementToggleBreakpointAdapter#canToggleLineBreakpoints(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object)
- */
- @Override
- public boolean canToggleLineBreakpoints( IPresentationContext presentationContext, Object element ) {
- if ( element instanceof IDisassemblyInstruction ) {
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see com.arm.eclipse.rvd.ui.disassembly.IElementToggleBreakpointAdapter#toggleLineBreakpoints(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object)
- */
- @Override
- public void toggleLineBreakpoints( IPresentationContext presentationContext, Object element ) throws CoreException {
- if ( element instanceof IDisassemblyInstruction ) {
- IDisassemblyInstruction instruction = (IDisassemblyInstruction)element;
- IBreakpoint breakpoint = findBreakpoint( instruction );
- if ( breakpoint != null ) {
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint( breakpoint, true );
- }
- else {
- IAddress address = instruction.getAdress();
- CDIDebugModel.createAddressBreakpoint(
- null,
- "", //$NON-NLS-1$
- ResourcesPlugin.getWorkspace().getRoot(),
- ICBreakpointType.REGULAR,
- -1,
- address,
- true,
- 0,
- "", //$NON-NLS-1$
- true );
- }
- }
- }
-
- private IBreakpoint findBreakpoint( IDisassemblyInstruction instruction ) {
- BigInteger address = instruction.getAdress().getValue();
- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
- for ( IBreakpoint bp : breakpoints ) {
- if ( bp instanceof ICLineBreakpoint ) {
- try {
- IAddress bpAddress = ((ICDebugTarget)instruction.getDebugTarget()).getBreakpointAddress( (ICLineBreakpoint)bp );
- if ( bpAddress != null && address.compareTo( bpAddress.getValue() ) == 0 )
- return bp;
- }
- catch( DebugException e ) {
- }
- }
- }
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/ElementAdapterMessages.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/ElementAdapterMessages.java
deleted file mode 100644
index 2acb0ac831..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/ElementAdapterMessages.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ElementAdapterMessages extends NLS {
- public static String RegistersViewColumnPresentation_0;
- public static String RegistersViewColumnPresentation_1;
- public static String RegistersViewColumnPresentation_2;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(ElementAdapterMessages.class.getName(), ElementAdapterMessages.class);
- }
-
- private ElementAdapterMessages() {
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/ElementAdapterMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/ElementAdapterMessages.properties
deleted file mode 100644
index 4c599b8cc0..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/ElementAdapterMessages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 ARM Limited 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:
-# ARM Limited - Initial API and implementation
-###############################################################################
-RegistersViewColumnPresentation_0=Type
-RegistersViewColumnPresentation_1=Name
-RegistersViewColumnPresentation_2=Value
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/RegistersViewColumnPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/RegistersViewColumnPresentation.java
deleted file mode 100644
index dc2a9e7f46..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/RegistersViewColumnPresentation.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Registers View columns
- */
-public class RegistersViewColumnPresentation implements IColumnPresentation {
-
- private static final String PREFIX = CDebugUIPlugin.PLUGIN_ID + "."; //$NON-NLS-1$
-
- public static final String ID = PREFIX + "registersViewColumnPresentationId"; //$NON-NLS-1$
-
- private static final String COLUMN_ID_NAME = VariableColumnPresentation.COLUMN_VARIABLE_NAME;
- private static final String COLUMN_ID_TYPE = VariableColumnPresentation.COLUMN_VARIABLE_TYPE;
- private static final String COLUMN_ID_VALUE = VariableColumnPresentation.COLUMN_VARIABLE_VALUE;
-
- private static final String[] ALL_COLUMNS = new String[] {
- COLUMN_ID_NAME,
- COLUMN_ID_TYPE,
- COLUMN_ID_VALUE
- };
-
- private static final String[] INITIAL_COLUMNS = new String[] {
- COLUMN_ID_NAME,
- COLUMN_ID_VALUE
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#init(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- @Override
- public void init( IPresentationContext context ) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#dispose()
- */
- @Override
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getAvailableColumns()
- */
- @Override
- public String[] getAvailableColumns() {
- return ALL_COLUMNS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getInitialColumns()
- */
- @Override
- public String[] getInitialColumns() {
- return INITIAL_COLUMNS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getHeader(java.lang.String)
- */
- @Override
- public String getHeader( String id ) {
- if ( COLUMN_ID_TYPE.equals( id ) ) {
- return ElementAdapterMessages.RegistersViewColumnPresentation_0;
- }
- if ( COLUMN_ID_NAME.equals( id ) ) {
- return ElementAdapterMessages.RegistersViewColumnPresentation_1;
- }
- if ( COLUMN_ID_VALUE.equals( id ) ) {
- return ElementAdapterMessages.RegistersViewColumnPresentation_2;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getImageDescriptor(java.lang.String)
- */
- @Override
- public ImageDescriptor getImageDescriptor( String id ) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getId()
- */
- @Override
- public String getId() {
- return ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#isOptional()
- */
- @Override
- public boolean isOptional() {
- return true;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/RegistersViewColumnPresentationFactory.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/RegistersViewColumnPresentationFactory.java
deleted file mode 100644
index 88f9884482..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/elements/adapters/RegistersViewColumnPresentationFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 CodeSourcery 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:
- * CodeSourcery - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.elements.adapters;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class RegistersViewColumnPresentationFactory implements IColumnPresentationFactory {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory#createColumnPresentation(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object)
- */
- @Override
- public IColumnPresentation createColumnPresentation( IPresentationContext context, Object element ) {
- if ( context.getId().equals( IDebugUIConstants.ID_REGISTER_VIEW ) )
- return new RegistersViewColumnPresentation();
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory#getColumnPresentationId(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object)
- */
- @Override
- public String getColumnPresentationId( IPresentationContext context, Object element ) {
- if ( context.getId().equals( IDebugUIConstants.ID_REGISTER_VIEW ) )
- return RegistersViewColumnPresentation.ID;
- return null;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java
index 4f925ebf1c..6808cbbb4b 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java
@@ -23,15 +23,11 @@ import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.debug.core.executables.Executable;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.cdt.debug.ui.ICDebuggerPage;
import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -40,7 +36,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -57,7 +52,6 @@ import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
@@ -121,53 +115,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 {
// user to choose one.
int candidateCount = candidateConfigs.size();
if (candidateCount < 1) {
- // Set the default debugger based on the active toolchain on the project (if possible)
- ICDebugConfiguration debugConfig = null;
- IProject project = bin.getResource().getProject();
- ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project);
- ICConfigurationDescription configDesc = projDesc.getActiveConfiguration();
- String configId = configDesc.getId();
- ICDebugConfiguration[] debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations();
- int matchLength = 0;
- for (int i = 0; i < debugConfigs.length; ++i) {
- ICDebugConfiguration dc = debugConfigs[i];
- String[] patterns = dc.getSupportedBuildConfigPatterns();
- if (patterns != null) {
- for (int j = 0; j < patterns.length; ++j) {
- if (patterns[j].length() > matchLength && configId.matches(patterns[j])) {
- debugConfig = dc;
- matchLength = patterns[j].length();
- }
- }
- }
- }
-
- if (debugConfig == null) {
- // Prompt the user if more then 1 debugger.
- String programCPU = bin.getCPU();
- String os = Platform.getOS();
- debugConfigs = CDebugCorePlugin.getDefault().getActiveDebugConfigurations();
- List<ICDebugConfiguration> debugList = new ArrayList<ICDebugConfiguration>(debugConfigs.length);
- for (int i = 0; i < debugConfigs.length; i++) {
- String platform = debugConfigs[i].getPlatform();
- if (debugConfigs[i].supportsMode(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN)) {
- if (platform.equals("*") || platform.equals(os)) { //$NON-NLS-1$
- if (debugConfigs[i].supportsCPU(programCPU))
- debugList.add(debugConfigs[i]);
- }
- }
- }
- debugConfigs = debugList.toArray(new ICDebugConfiguration[0]);
- if (debugConfigs.length == 1) {
- debugConfig = debugConfigs[0];
- } else if (debugConfigs.length > 1) {
- debugConfig = chooseDebugConfig(debugConfigs, mode);
- }
- }
-
- if (debugConfig != null) {
- configuration = createConfiguration(bin, debugConfig, mode);
- }
+ configuration = createConfiguration(bin, mode);
} else if (candidateCount == 1) {
configuration = candidateConfigs.get(0);
} else {
@@ -184,7 +132,7 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 {
* @param bin
* @return ILaunchConfiguration
*/
- private ILaunchConfiguration createConfiguration(IBinary bin, ICDebugConfiguration debugConfig, String mode) {
+ private ILaunchConfiguration createConfiguration(IBinary bin, String mode) {
ILaunchConfiguration config = null;
try {
String projectName = bin.getResource().getProjectRelativePath().toString();
@@ -197,7 +145,6 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 {
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, debugConfig.getID());
ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(bin.getCProject().getProject());
if (projDes != null) {
@@ -205,11 +152,6 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 {
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, buildConfigID);
}
- // Load up the debugger page to set the defaults. There should probably be a separate
- // extension point for this.
- ICDebuggerPage page = CDebugUIPlugin.getDefault().getDebuggerPage(debugConfig.getID());
- page.setDefaults(wc);
-
config = wc.doSave();
} catch (CoreException ce) {
CDebugUIPlugin.log(ce);
@@ -241,55 +183,6 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 {
}
/**
- * Method chooseDebugConfig.
- * @param debugConfigs
- * @param mode
- * @return ICDebugConfiguration
- */
- private ICDebugConfiguration chooseDebugConfig(ICDebugConfiguration[] debugConfigs, String mode) {
- ILabelProvider provider = new LabelProvider() {
- /**
- * The <code>LabelProvider</code> implementation of this
- * <code>ILabelProvider</code> method returns the element's <code>toString</code>
- * string. Subclasses may override.
- */
- @Override
- public String getText(Object element) {
- if (element == null) {
- return ""; //$NON-NLS-1$
- } else if (element instanceof ICDebugConfiguration) {
- return ((ICDebugConfiguration) element).getName();
- }
- return element.toString();
- }
- };
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider);
- dialog.setElements(debugConfigs);
- dialog.setTitle(getDebugConfigDialogTitleString(debugConfigs, mode));
- dialog.setMessage(getDebugConfigDialogMessageString(debugConfigs, mode));
- dialog.setMultipleSelection(false);
- int result = dialog.open();
- provider.dispose();
- if (result == Window.OK) {
- return (ICDebugConfiguration) dialog.getFirstResult();
- }
- return null;
- }
-
- protected String getDebugConfigDialogTitleString(ICDebugConfiguration [] configList, String mode) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.LaunchDebugConfigSelection"); //$NON-NLS-1$
- }
-
- protected String getDebugConfigDialogMessageString(ICDebugConfiguration [] configList, String mode) {
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.ChooseConfigToDebug"); //$NON-NLS-1$
- } else if (mode.equals(ILaunchManager.RUN_MODE)) {
- return LaunchMessages.getString("CApplicationLaunchShortcut.ChooseConfigToRun"); //$NON-NLS-1$
- }
- return LaunchMessages.getString("CApplicationLaunchShortcut.Invalid_launch_mode_1"); //$NON-NLS-1$
- }
-
- /**
* Show a selection dialog that allows the user to choose one of the specified
* launch configurations. Return the chosen config, or <code>null</code> if the
* user cancelled the dialog.
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java
index d923a5aba9..af3e825d6b 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java
@@ -9,6 +9,7 @@
* QNX Software Systems - Initial API and implementation
* Ken Ryall (Nokia) - 207675
* Mathias Kunter - Support for different charsets (bug 370462)
+ * Jonah Graham (Kichwa Coders) - Remove CDI
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.preferences;
@@ -16,7 +17,6 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCorePreferenceConstants;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDebugConstants;
-import org.eclipse.cdt.debug.core.cdi.ICDIFormat;
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
@@ -38,7 +38,6 @@ import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
@@ -57,32 +56,9 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
private IWorkbench fWorkbench;
- private Combo fVariableFormatCombo;
-
- private Combo fExpressionFormatCombo;
-
- private Combo fRegisterFormatCombo;
-
private EncodingFieldEditor fCharsetEditor;
private EncodingFieldEditor fWideCharsetEditor;
-
- // Format constants
- private static int[] fFormatIds = new int[] {
- ICDIFormat.NATURAL,
- ICDIFormat.HEXADECIMAL,
- ICDIFormat.DECIMAL,
- ICDIFormat.OCTAL,
- ICDIFormat.BINARY
- };
-
- private static String[] fFormatLabels = new String[] {
- PreferenceMessages.getString( "CDebugPreferencePage.0" ), //$NON-NLS-1$
- PreferenceMessages.getString( "CDebugPreferencePage.1" ), //$NON-NLS-1$
- PreferenceMessages.getString( "CDebugPreferencePage.2" ), //$NON-NLS-1$
- PreferenceMessages.getString( "CDebugPreferencePage.17" ), //$NON-NLS-1$
- PreferenceMessages.getString( "CDebugPreferencePage.14" ) //$NON-NLS-1$
- };
private PropertyChangeListener fPropertyChangeListener;
@@ -148,8 +124,6 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
data.horizontalAlignment = GridData.FILL;
composite.setLayoutData( data );
createSpacer( composite, 1 );
- createViewSettingPreferences( composite );
- createSpacer( composite, 1 );
createCharsetSettingPreferences( composite );
createSpacer( composite, 1 );
createBinarySettings( composite );
@@ -158,30 +132,9 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
}
/**
- * Creates composite group and sets the default layout data.
- *
- * @param parent
- * the parent of the new composite
- * @param numColumns
- * the number of columns for the new composite
- * @param labelText
- * the text label of the new composite
- * @return the newly-created composite
- */
- private Composite createGroupComposite( Composite parent, int numColumns, String labelText ) {
- return ControlFactory.createGroup( parent, labelText, numColumns );
- }
-
- /**
* Set the values of the component widgets based on the values in the preference store
*/
private void setValues() {
- // Set the number format combo boxes.
- fVariableFormatCombo.select(getFormatIndex(Platform.getPreferencesService().getInt(CDebugCorePlugin.PLUGIN_ID, ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT, ICDIFormat.NATURAL, null)));
- fExpressionFormatCombo.select(getFormatIndex(Platform.getPreferencesService().getInt(CDebugCorePlugin.PLUGIN_ID, ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT, ICDIFormat.NATURAL, null)));
- fRegisterFormatCombo.select(getFormatIndex(Platform.getPreferencesService().getInt(CDebugCorePlugin.PLUGIN_ID, ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT, ICDIFormat.NATURAL, null)));
-
-
// Set the charset editors.
// Create a temporary preference store.
@@ -265,18 +218,6 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
getPreferenceStore().removePropertyChangeListener( getPropertyChangeListener() );
}
- /**
- * Create the view setting preferences composite widget
- */
- private void createViewSettingPreferences( Composite parent ) {
- Composite comp = createGroupComposite( parent, 1, PreferenceMessages.getString( "CDebugPreferencePage.4" ) ); //$NON-NLS-1$
- Composite formatComposite = ControlFactory.createCompositeEx( comp, 2, 0 );
- ((GridLayout)formatComposite.getLayout()).makeColumnsEqualWidth = true;
- fVariableFormatCombo = createComboBox( formatComposite, PreferenceMessages.getString( "CDebugPreferencePage.8" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
- fExpressionFormatCombo = createComboBox( formatComposite, PreferenceMessages.getString( "CDebugPreferencePage.9" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
- fRegisterFormatCombo = createComboBox( formatComposite, PreferenceMessages.getString( "CDebugPreferencePage.10" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
- }
-
private void createCharsetSettingPreferences( Composite parent ) {
// Create containing composite
Composite formatComposite = ControlFactory.createComposite( parent, 2);
@@ -310,16 +251,6 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
return button;
}
- /**
- * Creates a button with the given label and sets the default configuration data.
- */
- private Combo createComboBox( Composite parent, String label, String[] items, String selection ) {
- ControlFactory.createLabel( parent, label );
- Combo combo = ControlFactory.createSelectCombo( parent, items, selection );
- combo.setLayoutData( new GridData() );
- return combo;
- }
-
protected void createSpacer( Composite composite, int columnSpan ) {
Label label = new Label( composite, SWT.NONE );
GridData gd = new GridData();
@@ -389,11 +320,6 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
* Store the preference values based on the state of the component widgets
*/
private void storeValues() {
- // Store the number formats.
- InstanceScope.INSTANCE.getNode(CDebugCorePlugin.PLUGIN_ID).putInt(ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT, getFormatId(fVariableFormatCombo.getSelectionIndex()));
- InstanceScope.INSTANCE.getNode(CDebugCorePlugin.PLUGIN_ID).putInt(ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT, getFormatId(fExpressionFormatCombo.getSelectionIndex()));
- InstanceScope.INSTANCE.getNode(CDebugCorePlugin.PLUGIN_ID).putInt(ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT, getFormatId(fRegisterFormatCombo.getSelectionIndex()));
-
// Store the charset.
if (fCharsetEditor.presentsDefaultValue()) {
InstanceScope.INSTANCE.getNode(CDebugCorePlugin.PLUGIN_ID).remove(ICDebugConstants.PREF_DEBUG_CHARSET);
@@ -426,25 +352,11 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
}
private void setDefaultValues() {
- fVariableFormatCombo.select(getFormatIndex(DefaultScope.INSTANCE.getNode(CDebugCorePlugin.PLUGIN_ID).getInt(ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT, ICDIFormat.NATURAL)));
- fExpressionFormatCombo.select(getFormatIndex(DefaultScope.INSTANCE.getNode(CDebugCorePlugin.PLUGIN_ID).getInt(ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT, ICDIFormat.NATURAL)));
- fRegisterFormatCombo.select(getFormatIndex(DefaultScope.INSTANCE.getNode(CDebugCorePlugin.PLUGIN_ID).getInt(ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT, ICDIFormat.NATURAL)));
fCharsetEditor.loadDefault();
fWideCharsetEditor.loadDefault();
fShowBinarySourceFilesButton.setSelection(DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID).getBoolean(CCorePreferenceConstants.SHOW_SOURCE_FILES_IN_BINARIES, true));
}
- private static int getFormatId( int index ) {
- return (index >= 0 && index < fFormatIds.length) ? fFormatIds[index] : fFormatIds[0];
- }
-
- private static int getFormatIndex( int id ) {
- for( int i = 0; i < fFormatIds.length; ++i )
- if ( fFormatIds[i] == id )
- return i;
- return -1;
- }
-
private IWorkbench getWorkbench() {
return fWorkbench;
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/DebuggerTypesPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/DebuggerTypesPage.java
deleted file mode 100644
index 66dfe31bbb..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/DebuggerTypesPage.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2012 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.preferences;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.cdt.debug.core.CDebugCorePlugin;
-import org.eclipse.cdt.debug.core.ICDebugConfiguration;
-import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
-import org.eclipse.cdt.debug.internal.ui.dialogfields.CheckedListDialogField;
-import org.eclipse.cdt.debug.internal.ui.dialogfields.DialogField;
-import org.eclipse.cdt.debug.internal.ui.dialogfields.IListAdapter;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.layout.PixelConverter;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * The "Debugger Types" preference page.
- */
-public class DebuggerTypesPage extends PreferencePage implements IWorkbenchPreferencePage {
-
- protected static String[] fgButtonLabels = new String[] { PreferenceMessages.getString( "DebuggerTypesPage.0" ), PreferenceMessages.getString( "DebuggerTypesPage.1" ), PreferenceMessages.getString( "DebuggerTypesPage.2" ) }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- /**
- * Comment for DebuggerTypesPage.
- */
- class DebuggerTypesDialogField extends CheckedListDialogField {
-
- public DebuggerTypesDialogField() {
- super( new IListAdapter() {
- @Override
- public void customButtonPressed( DialogField field, int index ) {
- }
-
- @Override
- public void selectionChanged( DialogField field ) {
- }
- }, fgButtonLabels, new DebuggerTypeLabelProvider() );
- }
-
- @Override
- public Control[] doFillIntoGrid( Composite parent, int nColumns ) {
- PixelConverter converter = new PixelConverter( parent );
- assertEnoughColumns( nColumns );
- Control list = getListControl( parent );
- GridData gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = true;
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessVerticalSpace = true;
- gd.horizontalSpan = nColumns - 2;
- gd.widthHint = converter.convertWidthInCharsToPixels( 50 );
- gd.heightHint = converter.convertHeightInCharsToPixels( 6 );
- list.setLayoutData( gd );
- Composite buttons = getButtonBox( parent );
- gd = new GridData();
- gd.horizontalAlignment = GridData.FILL;
- gd.grabExcessHorizontalSpace = false;
- gd.verticalAlignment = GridData.FILL;
- gd.grabExcessVerticalSpace = true;
- gd.horizontalSpan = 1;
- buttons.setLayoutData( gd );
- return new Control[]{ list, buttons };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.dialogfields.CheckedListDialogField#getManagedButtonState(org.eclipse.jface.viewers.ISelection, int)
- */
- @Override
- protected boolean getManagedButtonState( ISelection sel, int index ) {
- // Enable/disable the "Default" button
- if ( index == 2 && sel instanceof IStructuredSelection ) {
- Object o = ((IStructuredSelection)sel).getFirstElement();
- return o != null && isChecked( o );
- }
- return super.getManagedButtonState( sel, index );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.dialogfields.CheckedListDialogField#managedButtonPressed(int)
- */
- @Override
- protected boolean managedButtonPressed( int index ) {
- if ( index == 2 ) {
- List list = getSelectedElements();
- if ( !list.isEmpty() )
- setDefault( ((ICDebugConfiguration)list.get( 0 )).getID() );
- else
- setDefault( null );
- refresh();
- }
- return super.managedButtonPressed( index );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.dialogfields.ListDialogField#getListStyle()
- */
- @Override
- protected int getListStyle() {
- return SWT.BORDER + SWT.SINGLE + SWT.H_SCROLL + SWT.V_SCROLL;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.dialogfields.CheckedListDialogField#doCheckStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
- */
- @Override
- protected void doCheckStateChanged( CheckStateChangedEvent e ) {
- super.doCheckStateChanged( e );
- ICDebugConfiguration dc = (ICDebugConfiguration)e.getElement();
- if ( dc.getID().equals( getDefault() ) && !e.getChecked() ) {
- List list = getCheckedElements();
- setDefault( ( list.size() > 0 ) ? ((ICDebugConfiguration)list.get( 0 )).getID() : null );
- refresh();
- }
- else if ( e.getChecked() && getDefault() == null ) {
- setDefault( ((ICDebugConfiguration)e.getElement()).getID() );
- refresh();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.dialogfields.CheckedListDialogField#checkAll(boolean)
- */
- @Override
- public void checkAll( boolean state ) {
- super.checkAll( state );
- List list = getCheckedElements();
- setDefault( ( list.size() > 0 ) ? ((ICDebugConfiguration)list.get( 0 )).getID() : null );
- refresh();
- }
- }
-
- /**
- * Comment for DebuggerTypesPage.
- */
- class DebuggerTypeLabelProvider extends LabelProvider {
-
- @Override
- public String getText( Object element ) {
- if ( element instanceof ICDebugConfiguration ) {
- ICDebugConfiguration dc = (ICDebugConfiguration)element;
- String label = dc.getName();
- if ( dc.getID().equals( getDefault() ) )
- label += MessageFormat.format( " ({0})", new String[] { PreferenceMessages.getString( "DebuggerTypesPage.3" ) } ); //$NON-NLS-1$ //$NON-NLS-2$
- return label;
- }
- return super.getText( element );
- }
- }
-
- private DebuggerTypesDialogField fListField;
- private IWorkbench fWorkbench;
- private String fDefault;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createContents( Composite parent ) {
- Font font = parent.getFont();
- Composite comp = new Composite( parent, SWT.NONE );
- GridLayout topLayout = new GridLayout();
- topLayout.numColumns = 3;
- comp.setLayout( topLayout );
- GridData gd = new GridData( GridData.FILL_BOTH );
- comp.setLayoutData( gd );
- comp.setFont( font );
- Label viewerLabel = new Label( comp, SWT.LEFT );
- viewerLabel.setText( PreferenceMessages.getString( "DebuggerTypesPage.4" ) ); //$NON-NLS-1$
- gd = new GridData( GridData.HORIZONTAL_ALIGN_FILL );
- gd.horizontalSpan = 3;
- viewerLabel.setLayoutData( gd );
- viewerLabel.setFont( font );
- fListField = new DebuggerTypesDialogField();
- fListField.setCheckAllButtonIndex( 0 );
- fListField.setUncheckAllButtonIndex( 1 );
- Dialog.applyDialogFont( comp );
- fListField.doFillIntoGrid( comp, 3 );
- initialize();
- getWorkbench().getHelpSystem().setHelp( comp, ICDebugHelpContextIds.DEBUGGER_TYPES_PAGE );
- return comp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- @Override
- public void init( IWorkbench workbench ) {
- fWorkbench = workbench;
- }
-
- private IWorkbench getWorkbench() {
- return fWorkbench;
- }
-
- private void initialize() {
- ICDebugConfiguration dc = CDebugCorePlugin.getDefault().getDefaultDebugConfiguration();
- setDefault( ( dc != null ) ? dc.getID() : null );
- fListField.addElements( Arrays.asList( CDebugCorePlugin.getDefault().getDebugConfigurations() ) );
- fListField.setCheckedElements( Arrays.asList( CDebugCorePlugin.getDefault().getActiveDebugConfigurations() ) );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- @Override
- public boolean performOk() {
- CDebugCorePlugin.getDefault().saveDefaultDebugConfiguration( getDefault() );
- List elements = fListField.getElements();
- elements.removeAll( fListField.getCheckedElements() );
- CDebugCorePlugin.getDefault().saveFilteredDebugConfigurations( (ICDebugConfiguration[])elements.toArray( new ICDebugConfiguration[elements.size()] ) );
- return super.performOk();
- }
-
- protected String getDefault() {
- return fDefault;
- }
-
- protected void setDefault( String defaultConfiguration ) {
- fDefault = defaultConfiguration;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- @Override
- protected void performDefaults() {
- fListField.setCheckedElements( Arrays.asList( CDebugCorePlugin.getDefault().getDefaultActiveDebugConfigurations() ) );
- ICDebugConfiguration defaultConfiguration = CDebugCorePlugin.getDefault().getDefaultDefaultDebugConfiguration();
- if ( defaultConfiguration != null ) {
- setDefault( defaultConfiguration.getID() );
- }
- else {
- List list = fListField.getCheckedElements();
- if ( !list.isEmpty() ) {
- setDefault( ((ICDebugConfiguration)list.get( 0 )).getID() );
- }
- }
- fListField.refresh();
- super.performDefaults();
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties
index 7723772da2..b49542245b 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/PreferenceMessages.properties
@@ -12,21 +12,15 @@
###############################################################################
CDebugPreferencePage.Color_of_disassembly_source_lines_1=Color of source lines:
-CDebugPreferencePage.0=Default
-CDebugPreferencePage.1=Hexadecimal
-CDebugPreferencePage.2=Decimal
CDebugPreferencePage.3=General settings for C/C++ Debugging.
-CDebugPreferencePage.4=Default number format
CDebugPreferencePage.8=Variables:
CDebugPreferencePage.9=Expressions:
CDebugPreferencePage.10=Registers:
CDebugPreferencePage.11=Disassembly options
CDebugPreferencePage.12=Maximum number of displayed instructions:
CDebugPreferencePage.13=Value must be an integer between {0} and {1}.
-CDebugPreferencePage.14=Binary
CDebugPreferencePage.15=Show source files in binaries
CDebugPreferencePage.16=Wide character encoding
-CDebugPreferencePage.17=Octal
CDebugPreferencePage.18=Character encoding
CDebugPreferencePage.19=The selected character encoding is not supported.
CDebugPreferencePage.20=The selected wide character encoding is not supported.
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java
index 4ba2fb11fa..b7f626430b 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java
@@ -15,11 +15,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
-import org.eclipse.cdt.debug.core.model.ICVariable;
import org.eclipse.cdt.debug.core.model.provisional.IMemorySpaceAwareMemoryBlockRetrieval;
-import org.eclipse.cdt.debug.internal.core.CMemoryBlockRetrievalExtension;
import org.eclipse.cdt.debug.internal.core.CRequest;
-import org.eclipse.cdt.debug.internal.core.model.CRegister;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
@@ -355,56 +352,6 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
container.addMemoryRendering(rendering);
}
- public void addMemoryBlocksForVariables(ICVariable[] variables, IMemoryRenderingSite memSite) throws DebugException {
-
- IAdaptable debugViewElement = DebugUITools.getDebugContext();
-
-
- CMemoryBlockRetrievalExtension cdtRetrieval = null;
-
- {
- IMemoryBlockRetrieval retrieval = debugViewElement.getAdapter(IMemoryBlockRetrieval.class);
-
- if (retrieval == null && debugViewElement instanceof IDebugElement)
- retrieval = ((IDebugElement)debugViewElement).getDebugTarget();
-
- if (retrieval == null || !(retrieval instanceof CMemoryBlockRetrievalExtension))
- return;
-
- cdtRetrieval = (CMemoryBlockRetrievalExtension) retrieval;
- }
-
- String[] expressions = new String[variables.length];
- for (int i = 0; i < variables.length; i++) {
-
- String exp = variables[i].getExpressionString();
-
- if (variables[i].getType().isPointer() || variables[i].getType().isArray() ||
- variables[i].getType().isReference() || variables[i] instanceof CRegister)
- expressions[i] = exp;
- else
- expressions[i] = "&" + exp; //$NON-NLS-1$
- }
-
- ParamHolder params;
- params = new ExpressionsHolder(expressions);
-
- final IAdaptable debugViewElement_f = debugViewElement;
- final CMemoryBlockRetrievalExtension retrieval_f = cdtRetrieval;
- final ParamHolder params_f = params;
- final IMemoryRenderingSite memRendSite = memSite;
- Job job = new Job("Add Memory Block") { //$NON-NLS-1$
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- addMemoryBlocks(debugViewElement_f, retrieval_f, params_f,
- memRendSite);
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
/**
* Helper function to open an error dialog.
* @param title
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/modules/ModuleMementoProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/modules/ModuleMementoProvider.java
deleted file mode 100644
index 919dfd2a24..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/modules/ModuleMementoProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2015 ARM 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:
- * ARM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.views.modules;
-
-import org.eclipse.cdt.core.model.ICElement;
-import org.eclipse.cdt.debug.core.CDIDebugModel;
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICModule;
-import org.eclipse.cdt.debug.core.model.ICStackFrame;
-import org.eclipse.cdt.debug.core.model.ICThread;
-import org.eclipse.cdt.debug.core.model.IModuleRetrieval;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.model.elements.ElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.ui.IMemento;
-
-/**
- * org.eclipse.cdt.debug.internal.ui.views.modules.ModuleMementoProvider:
- * //TODO Add description.
- */
-public class ModuleMementoProvider extends ElementMementoProvider {
-
- /**
- * memento attribute
- */
- private static final String ELEMENT_NAME = "ELEMENT_NAME"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementMementoProvider#encodeElement(java.lang.Object, org.eclipse.ui.IMemento, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- @Override
- protected boolean encodeElement( Object element, IMemento memento, IPresentationContext context ) throws CoreException {
- if ( element instanceof ICDebugTarget || element instanceof ICThread || element instanceof ICStackFrame ) {
- IModuleRetrieval mr = ((IAdaptable)element).getAdapter( IModuleRetrieval.class );
- if ( mr != null ) {
- memento.putString( ELEMENT_NAME, mr.toString() );
- }
- else {
- // shouldn't happen
- memento.putString( ELEMENT_NAME, CDIDebugModel.getPluginIdentifier() );
- }
- }
- else if ( element instanceof ICModule ) {
- memento.putString( ELEMENT_NAME, ((ICModule)element).getName() );
- }
- else if ( element instanceof ICElement ) {
- memento.putString( ELEMENT_NAME, ((ICElement)element).getElementName() );
- }
- else {
- return false;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementMementoProvider#isEqual(java.lang.Object, org.eclipse.ui.IMemento, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- @Override
- protected boolean isEqual( Object element, IMemento memento, IPresentationContext context ) throws CoreException {
- String mementoName = memento.getString( ELEMENT_NAME );
- if ( mementoName != null ) {
- String elementName = null;
- if ( element instanceof ICDebugTarget || element instanceof ICThread || element instanceof ICStackFrame ) {
- IModuleRetrieval mr = ((IAdaptable)element).getAdapter( IModuleRetrieval.class );
- elementName = ( mr != null ) ? mr.toString() : CDIDebugModel.getPluginIdentifier();
- }
- else if ( element instanceof ICModule ) {
- elementName = ((ICModule)element).getName();
- }
- else if ( element instanceof ICElement ) {
- elementName = ((ICElement)element).getElementName();
- }
- if ( elementName != null ) {
- return elementName.equals( mementoName );
- }
- }
- return false;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsContentProvider.java
deleted file mode 100644
index 59557fbda0..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsContentProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2011 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- * Wind River Systems - flexible hierarchy Signals view (bug 338908)
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.views.signals;
-
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.cdt.debug.ui.ICDebugUIConstants;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-
-public class SignalsContentProvider extends ElementContentProvider {
-
- @Override
- protected int getChildCount( Object element, IPresentationContext context, IViewerUpdate monitor ) throws CoreException {
- return getAllChildren( element, context ).length;
- }
-
- @Override
- protected Object[] getChildren( Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor ) throws CoreException {
- return getElements( getAllChildren( parent, context ), index, length );
- }
-
- @Override
- protected boolean supportsContextId( String id ) {
- return ICDebugUIConstants.ID_SIGNALS_VIEW.equals( id );
- }
-
- protected Object[] getAllChildren(Object parent, IPresentationContext context) throws CoreException {
- if (parent instanceof ICDebugTarget) {
- ICDebugTarget target = (ICDebugTarget) parent;
- try {
- Object[] signals = target.getSignals();
- if (signals != null)
- return signals;
- } catch (DebugException e) {
- CDebugUIPlugin.log(e);
- }
- }
- return EMPTY;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java
deleted file mode 100644
index c1d7e87112..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsView.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2012 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.views.signals;
-
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.core.model.ICSignal;
-import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
-import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandlerView;
-import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.INullSelectionListener;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * Displays signals.
- *
- * @since: Mar 8, 2004
- */
-public class SignalsView extends AbstractDebugEventHandlerView
- implements ISelectionListener,
- INullSelectionListener,
- IPropertyChangeListener,
- IDebugExceptionHandler {
-
- public class SignalsViewLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- @Override
- public Image getColumnImage( Object element, int columnIndex ) {
- if ( columnIndex == 0 )
- return getModelPresentation().getImage( element );
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- @Override
- public String getColumnText( Object element, int columnIndex ) {
- if ( element instanceof ICSignal ) {
- try {
- switch( columnIndex ) {
- case 0:
- return ((ICSignal)element).getName();
- case 1:
- return (((ICSignal)element).isPassEnabled()) ? SignalsViewer.YES_VALUE : SignalsViewer.NO_VALUE;
- case 2:
- return (((ICSignal)element).isStopEnabled()) ? SignalsViewer.YES_VALUE : SignalsViewer.NO_VALUE;
- case 3:
- return ((ICSignal)element).getDescription();
- }
- } catch( DebugException e ) {
- }
- }
- return null;
- }
-
- private IDebugModelPresentation getModelPresentation() {
- return CDebugUIPlugin.getDebugModelPresentation();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Viewer createViewer( Composite parent ) {
-
- // add tree viewer
- final SignalsViewer vv = new SignalsViewer( parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL );
- vv.setContentProvider( createContentProvider() );
- vv.setLabelProvider( new SignalsViewLabelProvider() );
- vv.setUseHashlookup( true );
-
- // listen to preference changes
- CDebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this );
-
- // listen to selection in debug view
- getSite().getPage().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
- setEventHandler( new SignalsViewEventHandler( this ) );
-
- return vv;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#createActions()
- */
- @Override
- protected void createActions() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
- */
- @Override
- protected String getHelpContextId() {
- return ICDebugHelpContextIds.SIGNALS_VIEW;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- @Override
- protected void fillContextMenu( IMenuManager menu ) {
- menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
- updateObjects();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- @Override
- protected void configureToolBar( IToolBarManager tbm ) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void selectionChanged( IWorkbenchPart part, ISelection selection ) {
- if ( !isAvailable() || !isVisible() )
- return;
- if ( selection == null )
- setViewerInput( new StructuredSelection() );
- else if ( selection instanceof IStructuredSelection )
- setViewerInput( (IStructuredSelection)selection );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- @Override
- public void propertyChange( PropertyChangeEvent event ) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler#handleException(org.eclipse.debug.core.DebugException)
- */
- @Override
- public void handleException( DebugException e ) {
- showMessage( e.getMessage() );
- }
-
- /**
- * Creates this view's content provider.
- *
- * @return a content provider
- */
- private IContentProvider createContentProvider() {
- SignalsViewContentProvider cp = new SignalsViewContentProvider();
- cp.setExceptionHandler( this );
- return cp;
- }
-
- protected void setViewerInput( IStructuredSelection ssel ) {
- ICDebugTarget target = null;
- if ( ssel != null && ssel.size() == 1 ) {
- Object input = ssel.getFirstElement();
- if ( input instanceof IDebugElement && ((IDebugElement)input).getDebugTarget() instanceof ICDebugTarget )
- target = (ICDebugTarget)((IDebugElement)input).getDebugTarget();
- }
-
- if ( getViewer() == null )
- return;
-
- Object current = getViewer().getInput();
- if ( current != null && current.equals( target ) ) {
- updateObjects();
- return;
- }
-
- showViewer();
- getViewer().setInput( target );
- updateObjects();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#becomesHidden()
- */
- @Override
- protected void becomesHidden() {
- setViewerInput( new StructuredSelection() );
- super.becomesHidden();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
- */
- @Override
- protected void becomesVisible() {
- super.becomesVisible();
- IViewPart part = getSite().getPage().findView( IDebugUIConstants.ID_DEBUG_VIEW );
- if ( part != null ) {
- ISelection selection = getSite().getPage().getSelection( IDebugUIConstants.ID_DEBUG_VIEW );
- selectionChanged( part, selection );
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- @Override
- public void dispose() {
- getSite().getPage().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
- CDebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this );
- super.dispose();
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java
deleted file mode 100644
index cff6e01170..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/signals/SignalsViewContentProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2012 QNX Software 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:
- * QNX Software Systems - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.cdt.debug.internal.ui.views.signals;
-
-import org.eclipse.cdt.debug.core.model.ICDebugTarget;
-import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler;
-import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-
-/**
- * Provides content for the signals view.
- *
- * @since: Mar 8, 2004
- */
-public class SignalsViewContentProvider implements IStructuredContentProvider {
-
- /**
- * Handler for exceptions as content is retrieved
- */
- private IDebugExceptionHandler fExceptionHandler = null;
-
- public SignalsViewContentProvider() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- @Override
- public Object[] getElements( Object inputElement ) {
- if ( inputElement instanceof ICDebugTarget ) {
- ICDebugTarget target = (ICDebugTarget)inputElement;
- try {
- Object[] signals = target.getSignals();
- if ( signals != null )
- return signals;
- }
- catch( DebugException e ) {
- if ( getExceptionHandler() != null )
- getExceptionHandler().handleException( e );
- else
- CDebugUIPlugin.log( e );
- }
- }
- return new Object[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- @Override
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
- }
-
- /**
- * Sets an exception handler for this content provider.
- *
- * @param handler debug exception handler or <code>null</code>
- */
- protected void setExceptionHandler(IDebugExceptionHandler handler) {
- fExceptionHandler = handler;
- }
-
- /**
- * Returns the exception handler for this content provider.
- *
- * @return debug exception handler or <code>null</code>
- */
- protected IDebugExceptionHandler getExceptionHandler() {
- return fExceptionHandler;
- }
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java
index 56e767ca6b..0e5d387606 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java
@@ -16,16 +16,12 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
-import org.eclipse.cdt.debug.core.model.ICDebugElement;
import org.eclipse.cdt.debug.internal.ui.CDebugImageDescriptorRegistry;
import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation;
import org.eclipse.cdt.debug.internal.ui.CDebuggerPageAdapter;
-import org.eclipse.cdt.debug.internal.ui.CRegisterManagerProxies;
import org.eclipse.cdt.debug.internal.ui.ColorManager;
-import org.eclipse.cdt.debug.internal.ui.EvaluationContextManager;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.internal.ui.breakpoints.CBreakpointUpdater;
-import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyBackendCdiFactory;
import org.eclipse.cdt.debug.internal.ui.disassembly.editor.DisassemblyEditorManager;
import org.eclipse.cdt.debug.internal.ui.pinclone.ViewIDCounterManager;
import org.eclipse.cdt.debug.ui.sourcelookup.DefaultSourceLocator;
@@ -292,9 +288,6 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
fDisassemblyEditorManager = new DisassemblyEditorManager();
CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() );
- // Register the CDI backend for DSF's disassembly view
- Platform.getAdapterManager().registerAdapters(new DisassemblyBackendCdiFactory(), ICDebugElement.class);
-
WorkbenchJob wjob = new WorkbenchJob("Initializing CDT Debug UI") { //$NON-NLS-1$
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
@@ -306,7 +299,6 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
}
private void startupInUIThread() {
- EvaluationContextManager.startup();
ViewIDCounterManager.getInstance().init();
// We contribute actions to the platform's Variables view with a
@@ -339,7 +331,6 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
@Override
public void stop( BundleContext context ) throws Exception {
CDebugCorePlugin.getDefault().removeCBreakpointListener( CBreakpointUpdater.getInstance() );
- CRegisterManagerProxies.getInstance().dispose();
fDisassemblyEditorManager.dispose();
if ( fImageDescriptorRegistry != null ) {
fImageDescriptorRegistry.dispose();
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java
index 95b04e7897..df35adf8e2 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpoints/AbstractToggleBreakpointAdapter.java
@@ -34,7 +34,6 @@ import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
import org.eclipse.cdt.debug.internal.core.CRequest;
-import org.eclipse.cdt.debug.internal.core.model.CMemoryBlockExtension;
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.internal.ui.actions.ActionMessages;
@@ -487,9 +486,7 @@ abstract public class AbstractToggleBreakpointAdapter
}
private String getMemorySpace(IMemoryBlock memBlock, String def) {
- if (memBlock != null && memBlock instanceof CMemoryBlockExtension) {
- return ((CMemoryBlockExtension)memBlock).getMemorySpaceID();
- }
+ // XXX: In pre-CDI removal this retrieved memory space from CMemoryBlockExtension
return def;
}

Back to the top