Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/dsf
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 16:20:42 +0000
committerJonah Graham2018-11-22 21:47:02 +0000
commit170e654b4796bad1453ae85a427b97317d67a69a (patch)
tree6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /dsf
parent35996a5c5ca5c254959ba48241eaada6dbf8628d (diff)
downloadorg.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Format source code - Remove trailing white spaces on all lines and completing the wizard Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'dsf')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DebugTextHoverAdapterFactory.java50
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java48
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java84
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java287
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IDsfDebugHelpContextIds.java24
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IInternalDsfDebugUIConstants.java14
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/Messages.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/PreferenceInitializer.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/SuspendResumeAdapterFactory.java133
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java60
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java631
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyMoveToLineAdapter.java45
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyResumeAtLineAdapter.java45
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyRunToLineAdapter.java34
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfAddRegisterGroupCommand.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfEditRegisterGroupCommand.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRemoveRegisterGroupsCommand.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRestoreRegisterGroupsCommand.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/IDsfActionsConstants.java7
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/MoveToLine.java290
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/ResumeAtLine.java288
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RetargettableActionAdapterFactory.java14
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RunToLine.java306
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/DebugViewLayoutTester.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfDebugViewLayoutCommand.java167
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfGroupDebugContextsCommand.java9
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfUngroupDebugContextsCommand.java13
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java86
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java37
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java808
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java7
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java45
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyDropAdapter.java9
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyHyperlinkDetector.java17
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java79
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java11
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java1024
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblySelectionProvider.java7
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyToggleBreakpointTester.java42
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java40
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyViewerConfiguration.java31
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/EditionFinderJob.java12
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/FunctionOffsetRulerColumn.java12
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/IDisassemblyHelpContextIds.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourceColorerJob.java13
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourcePosition.java12
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java15
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyBreakpointRulerAction.java7
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerAction.java10
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerActionDelegate.java39
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoAddress.java5
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoProgramCounter.java1
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionOpenPreferences.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddBreakpointRulerAction.java153
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddressBarContributionItem.java64
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/BreakpointPropertiesRulerAction.java101
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/JumpToAddressAction.java42
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointActionDelegate.java5
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointHandler.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/TextOperationAction.java73
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/Addr2Line.java19
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java78
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java275
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyWithSourcePosition.java11
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/SourceDocumentProvider.java16
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/SourceEditorInput.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/SourceFileInfo.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/SourceReadingJob.java5
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferenceConstants.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/preferences/DisassemblyPreferencePage.java79
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/CSourcePresentationCreator.java73
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/CSourceTag.java28
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/CSourceTagProvider.java18
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/DisassemblyIPAnnotation.java24
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/ISourcePresentationCreator.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/ISourceRange.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/ISourceTag.java64
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/ISourceTagListener.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/ISourceTagProvider.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/SourcePresentationCreatorFactory.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/SourceTagDamagerRepairer.java164
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyAnnotationModel.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyRulerColumn.java234
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblySelection.java10
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyViewer.java27
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/IBreakpointLocationProvider.java16
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/IDisassemblyPart.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/IDisassemblySelection.java10
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/IFileRider.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDDocument.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDFile.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDFileRider.java9
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDRun.java3
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDTextStore.java94
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/StringRider.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/StringTextStore.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/util/HSL.java32
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/util/StorageEditorInput.java5
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/preferences/DecoratingIntegerFieldEditor.java47
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/preferences/DecoratingStringFieldEditor.java77
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/preferences/DsfDebugPreferencePage.java38
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/preferences/IntegerWithBooleanFieldEditor.java81
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/preferences/StringWithBooleanFieldEditor.java90
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/sourcelookup/DsfSourceSelectionResolver.java34
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/DsfCastToTypeSupport.java210
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/VMViewerUpdateTracing.java38
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/DsfViewMemoryHandler.java102
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/MessagesForVMActions.java27
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/RefreshActionDelegate.java58
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/RefreshAllRetargetAction.java28
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/RefreshHandler.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/RetargetDebugContextAction.java232
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/UpdatePoliciesContribution.java146
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/UpdatePoliciesPropertyTester.java80
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/detailsupport/DetailPaneMaxLengthAction.java16
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/detailsupport/DetailPaneMaxLengthDialog.java180
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/detailsupport/DetailPaneWordWrapAction.java23
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/detailsupport/MessagesForDetailPane.java26
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/detailsupport/TextViewerAction.java110
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/MessagesForNumberFormatDetailPane.java27
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java1441
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPaneFactory.java92
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java235
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/DsfDebugTextHover.java27
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/DsfDebugUITools.java14
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java77
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/AbstractDisassemblyBreakpointsTarget.java424
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfCommandRunnable.java143
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfResumeCommand.java192
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfStepIntoCommand.java118
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfStepIntoSelectionCommand.java36
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfStepIntoSelectionHyperlinkDetector.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfStepOverCommand.java122
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfStepReturnCommand.java109
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfSteppingModeTarget.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/DsfSuspendCommand.java192
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/actions/IDsfStepIntoSelection.java5
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/contexts/DsfSuspendTrigger.java608
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/memory/RefreshAction.java49
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/memory/SelectUpdatePolicyAction.java181
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java14
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/IInstructionPointerPresentation.java19
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerImageProvider.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/InstructionPointerManager.java393
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/Messages.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/SourceLookupResult.java192
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/AbstractDebugVMAdapter.java88
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/ErrorLabelForeground.java60
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/ErrorLabelText.java94
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/IDebugVMConstants.java182
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/MessagesForDebugVM.java19
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SimpleMapPersistable.java108
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SimpleMapPersistableFactory.java13
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/SteppingController.java816
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/actions/AbstractVMProviderActionDelegate.java145
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/actions/DefaultRefreshAllTarget.java48
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/actions/IRefreshAllTarget.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/actions/VMHandlerUtils.java276
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/AbstractBreakpointVMNode.java505
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointOrganizerVMContext.java99
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointOrganizerVMNode.java247
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMContext.java71
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMInput.java68
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMModelProxyStrategy.java65
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMNode.java464
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointVMProvider.java636
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/BreakpointsChangedEvent.java38
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/DataCache.java398
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/breakpoints/RawBreakpointVMNode.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/AbstractExpressionVMNode.java283
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/DisabledExpressionVMNode.java256
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionColumnPresentation.java95
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionManagerVMNode.java608
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProvider.java720
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProviderContentStragegy.java109
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionVMProviderModelProxyStrategy.java303
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionsBreakpointHitUpdatePolicy.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionsChangedEvent.java99
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionsChangedUpdateTester.java98
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/ExpressionsManualUpdatePolicy.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/IExpressionUpdate.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/IExpressionVMNode.java83
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/InvalidExpressionVMContext.java133
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/MessagesForExpressionVM.java38
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/SingleExpressionVMNode.java432
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/VMExpressionUpdate.java105
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/WatchExpressionCellModifier.java171
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/WatchExpressionDelegate.java46
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractContainerVMNode.java751
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractExecutionContextVMNode.java321
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java437
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java671
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/DefaultDsfModelSelectionPolicyFactory.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/DefaultDsfSelectionPolicy.java185
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/DelayedStackRefreshUpdatePolicy.java186
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java197
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExpandStackEvent.java10
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/FullStackRefreshEvent.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java35
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/LaunchRootVMNode.java200
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/LaunchVMUpdateMessages.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/MessagesForLaunchVM.java70
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java1622
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StandardProcessVMNode.java288
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StateChangedEvent.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/actions/ExpandStackAction.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/MessagesForModulesVM.java16
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/ModulesVMNode.java354
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/ModulesVMProvider.java85
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPane.java896
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPaneFactory.java7
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModulesAbstractDetailPane.java69
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModulesMessages.java9
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/AbstractElementVMProvider.java15
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java296
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatsContribution.java65
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueLabelText.java126
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueRetriever.java1285
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java710
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/IElementFormatProvider.java54
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/IFormattedValueVMContext.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/MessagesForNumberFormat.java38
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsContribution.java169
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/NumberFormatsPropertyTester.java105
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/RestoreNumberFormatPreferenceContribution.java10
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/IRegisterVMConstants.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/MessagesForRegisterVM.java70
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterBitFieldCellModifier.java325
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterBitFieldVMNode.java2009
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterCellModifier.java232
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterColumnPresentation.java88
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterGroupVMNode.java1099
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterRootDMVMNode.java60
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMNode.java1850
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMProvider.java404
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/SyncRegisterDataAccess.java1537
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/BreakpointHitUpdatePolicy.java90
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/DebugManualUpdatePolicy.java208
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/ElementFormatEvent.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/ElementFormatUpdateTester.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/update/MessagesForVMUpdate.java18
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/MessagesForVariablesVM.java54
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java1026
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableCellModifier.java216
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableColumnPresentation.java90
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableLabelFont.java10
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java2512
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMProvider.java243
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/internal/ui/DsfUILabelImage.java10
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/internal/ui/DsfUIPlugin.java190
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/DisplayDsfExecutor.java276
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java153
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/ViewerCountingRequestMonitor.java73
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/ViewerDataRequestMonitor.java166
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/ViewerRequestMonitor.java61
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java380
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMContext.java86
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMNode.java136
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMProvider.java1490
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMContentProviderStrategy.java657
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/DefaultVMModelProxyStrategy.java1521
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/IRootVMNode.java38
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/IVMAdapter.java41
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/IVMContext.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/IVMEventListener.java14
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/IVMModelProxy.java114
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/IVMNode.java91
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/IVMProvider.java150
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/ModelProxyInstalledEvent.java62
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/RootVMNode.java99
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenCountUpdate.java81
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java216
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMDelta.java446
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMHasChildrenUpdate.java80
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMViewerUpdate.java366
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/AbstractDMVMAdapter.java150
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/AbstractDMVMNode.java675
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/AbstractDMVMProvider.java41
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/CompositeDMVMContext.java86
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/IDMVMContext.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/RootDMVMNode.java129
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/IElementPropertiesProvider.java37
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/IPropertiesUpdate.java48
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/IPropertiesUpdateListener.java24
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelAttribute.java186
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelBackground.java50
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelColumnInfo.java241
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelFont.java60
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelForeground.java50
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelImage.java56
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/LabelText.java133
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/MessagesForProperties.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesBasedLabelProvider.java405
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/PropertiesUpdateStatus.java418
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMDelegatingPropertiesUpdate.java84
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java243
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java2630
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AutomaticUpdatePolicy.java72
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ICacheEntry.java130
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ICachingVMProvider.java114
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ICachingVMProviderExtension2.java19
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/IElementUpdateTester.java48
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/IElementUpdateTesterExtension.java26
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/IVMUpdatePolicy.java168
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/IVMUpdatePolicyExtension.java31
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ManualUpdatePolicy.java268
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelBackground.java46
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/StaleDataLabelForeground.java46
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/UpdatePolicyDecorator.java40
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/UserEditEvent.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/ViewModelUpdateMessages.java38
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java618
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ConfinedToDsfExecutor.java16
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/CountingRequestMonitor.java140
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DataRequestMonitor.java107
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DefaultDsfExecutor.java893
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutable.java225
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfExecutor.java27
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfMultiStatus.java78
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/DsfRunnable.java9
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ICache.java44
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/IDsfStatusConstants.java75
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateCountingRequestMonitor.java9
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateDataRequestMonitor.java9
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateExecutor.java75
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateInDsfExecutor.java52
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ImmediateRequestMonitor.java9
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/Immutable.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/MultiRequestMonitor.java220
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/Query.java294
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RangeCache.java585
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ReflectionSequence.java331
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestCache.java165
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitor.java799
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/RequestMonitorWithProgress.java34
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/Sequence.java1344
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/StackTraceWrapper.java60
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ThreadSafe.java12
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/ThreadSafeAndProhibitedFromDsfExecutor.java26
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/Transaction.java222
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/AbstractDMContext.java245
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/AbstractDMEvent.java23
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/CompositeDMContext.java147
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DMContexts.java376
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/DataModelInitializedEvent.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/IDMContext.java69
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/IDMData.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/IDMEvent.java10
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/IMemoryBlockRetrievalManager.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/IMemoryBlockUpdatePolicyProvider.java14
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalFactory.java18
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/model/MemoryBlockRetrievalManager.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/internal/provisional/service/IExecutionContextTranslator.java58
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java64
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java1014
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java407
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/AbstractDsfDebugServicesFactory.java116
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/AbstractInstruction.java18
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java1431
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java1436
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpointAttributeTranslator.java79
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpointAttributeTranslator2.java116
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpoints.java209
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IBreakpointsExtension.java52
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/ICachingService.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IDisassembly.java47
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IDisassembly2.java11
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IDisassembly3.java32
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IDsfBreakpointExtension.java130
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IDsfDebugServicesFactory.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IExpressions.java641
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IExpressions2.java54
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IExpressions3.java48
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IFormattedValues.java239
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IInstruction.java62
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IInstructionWithRawOpcodes.java2
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IInstructionWithSize.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMemory.java177
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMemorySpaces.java63
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMemorySpaces2.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMixedInstruction.java32
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IModules.java172
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IModules2.java40
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMultiDetach.java54
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMultiRunControl.java209
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMultiTerminate.java46
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IProcesses.java287
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IRegisters.java399
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IRegisters2.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IRunControl.java292
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IRunControl2.java35
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IRunControl3.java18
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/ISignals.java13
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/ISourceLookup.java32
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IStack.java212
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/ISymbols.java62
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/BufferedCommandControl.java272
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/CommandCache.java1184
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/ICommand.java47
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/ICommandControl.java70
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/ICommandControlService.java90
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/ICommandListener.java42
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/ICommandResult.java26
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/ICommandToken.java12
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/command/IEventListener.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupDirector.java14
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/sourcelookup/DsfSourceLookupParticipant.java281
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/internal/DsfPlugin.java78
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/internal/LoggingUtils.java28
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java399
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfServiceEventHandler.java16
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfServices.java36
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfServicesTracker.java485
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/DsfSession.java969
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/IDsfService.java160
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/PDAAdapterFactory.java62
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/PDASuspendTrigger.java55
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/PDAUIPlugin.java300
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/SessionAdapterSet.java196
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/actions/PDATerminateCommand.java177
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/breakpoints/PDABreakpointAdapter.java178
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/breakpoints/PDAEditorAdapterFactory.java25
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/breakpoints/PDAWatchpointFunctionFieldEditorFactory.java12
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/AnnotationHover.java4
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java139
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistant.java40
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAEditor.java46
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAScanner.java125
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDASourceViewerConfiguration.java53
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PopFrameActionDelegate.java43
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/TextHover.java117
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/WordFinder.java62
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/launcher/PDAMainTab.java56
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/launcher/PDATabGroup.java14
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/PDAExpressionVMProvider.java15
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/PDAVMAdapter.java51
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/launch/PDALaunchVMProvider.java60
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/launch/PDAThreadsVMNode.java140
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/viewmodel/launch/PDAVirtualMachineVMNode.java182
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java2830
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/PDAPlugin.java145
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/breakpoints/PDALineBreakpoint.java22
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/breakpoints/PDAWatchpoint.java234
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/launch/PDALaunch.java405
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/launch/PDALaunchDelegate.java235
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/launch/PDAServicesInitSequence.java189
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/launch/PDAServicesShutdownSequence.java195
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABackend.java414
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpointAttributeTranslator.java472
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDABreakpoints.java725
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDACommandControl.java964
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAExpressions.java1026
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDARegisters.java1152
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDARunControl.java1187
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAStack.java844
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAStartedEvent.java12
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDATerminatedEvent.java12
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAThreadDMContext.java54
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAVirtualMachineDMContext.java115
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/AbstractPDACommand.java98
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDABitField.java40
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAChildrenCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAClearBreakpointCommand.java20
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDACommandResult.java53
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDADataCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDADropFrameCommand.java26
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAEvalCommand.java28
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAEventStopCommand.java34
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAExitCommand.java20
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAFrame.java42
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAFrameCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAFrameCommandResult.java23
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAGroupsCommand.java22
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAListResult.java43
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAPopDataCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAPushDataCommand.java22
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegister.java42
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegistersCommand.java22
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDARegistersCommandResult.java35
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAResumeCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDASetBreakpointCommand.java25
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDASetDataCommand.java22
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDASetVarCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStackCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStackCommandResult.java37
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStackDepthCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStackDepthCommandResult.java26
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStepCommand.java26
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAStepReturnCommand.java26
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDASuspendCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAVMResumeCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAVMSuspendCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAVarCommand.java24
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/commands/PDAWatchCommand.java53
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/sourcelookup/PDASourceLookupDirector.java6
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/sourcelookup/PDASourcePathComputerDelegate.java18
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/DsfExamplesPlugin.java62
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileBrowserAction.java34
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileBrowserDialog.java159
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileBrowserModelAdapter.java53
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileBrowserVMProvider.java147
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileVMContext.java49
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FileVMNode.java550
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/filebrowser/FilesystemRootsVMNode.java335
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/AlarmService.java423
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/AlarmsVMNode.java140
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/ServicesShutdownSequence.java136
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/ServicesStartupSequence.java76
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimerService.java299
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimersRootVMNode.java64
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimersVMAdapter.java31
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimersVMNode.java250
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimersVMProvider.java265
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimersView.java485
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TimersViewColumnPresentation.java80
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TriggerCellModifier.java450
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src/org/eclipse/cdt/examples/dsf/timers/TriggersVMNode.java304
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src_ant/org/eclipse/cdt/examples/ant/tasks/PreProcessor.java178
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/DsfTestPlugin.java31
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/IViewerUpdatesListenerConstants.java66
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ServiceEventWaitor.java51
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/TestDsfExecutor.java68
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ValueHolder.java8
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java1232
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/BreakpointMediatorTests.java296
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoint.java89
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpointAttributeTranslator2.java139
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoints.java622
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/CacheTests.java1474
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfQueryTests.java564
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfSequenceProgressTests.java390
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/DsfSequenceTests.java1062
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/RangeCacheTests.java867
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/RmPerformanceTests.java142
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/concurrent/TransactionTests.java292
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTest1.java197
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/debug/vm/launch/VMTestBase.java147
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/dm/DMContextsTest.java185
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/AbstractService.java183
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/Event1.java3
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/Event2.java2
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/EventTest.java396
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/Service1.java47
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/Service2.java49
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/Service3.java49
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/Service4.java70
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/ShutdownSequence.java106
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/events/StartupSequence.java55
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/BasicTests.java218
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/CommandControlTestsBase.java257
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/PDATestCommand.java20
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/PDATestEvent.java13
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/Test1.java44
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/Test10.java108
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/Test2.java346
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/Test3.java124
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/Test6.java112
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/Test8.java134
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/service/command/Test9.java336
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/pda/util/Launching.java45
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/service/MultiInstanceTestService.java73
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/service/ServiceTests.java514
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/service/SimpleTestService.java61
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/DummyFormattedValueService.java89
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValueTests.java1645
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/FormattedValuesListener.java341
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/IFormattedValuesListener.java8
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/JFaceViewerFormattedValueTests.java28
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/JFaceViewerPerformanceTests.java28
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/PerformanceTests.java397
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestDsfVMPlugin.java6
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestElementFormatVMProvider.java13
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestElementVMContext.java62
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModel.java1246
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelCachingVMProvider.java186
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelDMVMNode.java446
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelUpdatesListener.java315
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMAdapter.java18
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMNode.java260
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModelVMProvider.java64
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/VirtualViewerPerformanceTests.java28
585 files changed, 56665 insertions, 55915 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java
index 57fc7705fdc..75a4cc3cd42 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java
@@ -85,7 +85,7 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory {
/**
* Creates a brief description of stack frame data. Based on code in
* StackFrameVMNode.
- *
+ *
* @param frame
* @return the frame description
*/
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DebugTextHoverAdapterFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DebugTextHoverAdapterFactory.java
index 2c183fb1c3b..70f0d5a674a 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DebugTextHoverAdapterFactory.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DebugTextHoverAdapterFactory.java
@@ -23,36 +23,36 @@ import org.eclipse.core.runtime.IAdapterFactory;
/**
* Adapter factory adapting an {@link IDMVMContext} to an {@link ICEditorTextHover}.
- *
+ *
* @since 2.1
*/
public class DebugTextHoverAdapterFactory implements IAdapterFactory {
- private static final Class<?>[] TYPES = { ICEditorTextHover.class };
- private static final Object fDebugTextHover= new DsfDebugTextHover();
-
- @SuppressWarnings("unchecked")
+ private static final Class<?>[] TYPES = { ICEditorTextHover.class };
+ private static final Object fDebugTextHover = new DsfDebugTextHover();
+
+ @SuppressWarnings("unchecked")
@Override
- public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
- if (adaptableObject instanceof IDMVMContext) {
- IDMContext dmc = ((IDMVMContext) adaptableObject).getDMContext();
- // try session specific hover
- T sessionHover = dmc.getAdapter(adapterType);
- if (sessionHover != null) {
- return sessionHover;
- }
- // use default
- IFrameDMContext frameDmc = DMContexts.getAncestorOfType(dmc, IFrameDMContext.class);
- if (frameDmc != null) {
- return (T)fDebugTextHover;
- }
- }
- return null;
- }
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
+ if (adaptableObject instanceof IDMVMContext) {
+ IDMContext dmc = ((IDMVMContext) adaptableObject).getDMContext();
+ // try session specific hover
+ T sessionHover = dmc.getAdapter(adapterType);
+ if (sessionHover != null) {
+ return sessionHover;
+ }
+ // use default
+ IFrameDMContext frameDmc = DMContexts.getAncestorOfType(dmc, IFrameDMContext.class);
+ if (frameDmc != null) {
+ return (T) fDebugTextHover;
+ }
+ }
+ return null;
+ }
- @Override
- public Class<?>[] getAdapterList() {
- return TYPES;
- }
+ @Override
+ public Class<?>[] getAdapterList() {
+ return TYPES;
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java
index e785db96408..0d54e8c153c 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/DisassemblyToggleBreakpointsTarget.java
@@ -34,39 +34,37 @@ public class DisassemblyToggleBreakpointsTarget extends AbstractDisassemblyBreak
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.AbstractDisassemblyBreakpointsTarget#createLineBreakpoint(java.lang.String, org.eclipse.core.resources.IResource, int)
*/
@Override
- protected void createLineBreakpoint( String sourceHandle, IResource resource, int lineNumber ) throws CoreException {
- CDIDebugModel.createLineBreakpoint( sourceHandle, resource, getBreakpointType(), lineNumber, true, 0, "", true ); //$NON-NLS-1$
+ protected void createLineBreakpoint(String sourceHandle, IResource resource, int lineNumber) throws CoreException {
+ CDIDebugModel.createLineBreakpoint(sourceHandle, resource, getBreakpointType(), lineNumber, true, 0, "", true); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void createLineBreakpointInteractive(IWorkbenchPart part, String sourceHandle, IResource resource,
+ int lineNumber) throws CoreException {
+ ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineBreakpoint();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ CDIDebugModel.setLineBreakpointAttributes(attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0,
+ ""); //$NON-NLS-1$
+ openBreakpointPropertiesDialog(lineBp, part, resource, attributes);
}
- @Override
- protected void createLineBreakpointInteractive(IWorkbenchPart part, String sourceHandle, IResource resource,
- int lineNumber) throws CoreException
- {
- ICLineBreakpoint lineBp = CDIDebugModel.createBlankLineBreakpoint();
- Map<String, Object> attributes = new HashMap<String, Object>();
- CDIDebugModel.setLineBreakpointAttributes(
- attributes, sourceHandle, getBreakpointType(), lineNumber, true, 0, "" ); //$NON-NLS-1$
- openBreakpointPropertiesDialog(lineBp, part, resource, attributes);
- }
-
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.AbstractDisassemblyBreakpointsTarget#createAddressBreakpoint(org.eclipse.core.resources.IResource, org.eclipse.cdt.core.IAddress)
*/
@Override
- protected void createAddressBreakpoint( IResource resource, IAddress address ) throws CoreException {
- CDIDebugModel.createAddressBreakpoint( null, null, resource, getBreakpointType(), address, true, 0, "", true ); //$NON-NLS-1$
+ protected void createAddressBreakpoint(IResource resource, IAddress address) throws CoreException {
+ CDIDebugModel.createAddressBreakpoint(null, null, resource, getBreakpointType(), address, true, 0, "", true); //$NON-NLS-1$
}
- @Override
- protected void createAddressBreakpointInteractive(IWorkbenchPart part, IResource resource, IAddress address)
- throws CoreException
- {
- ICLineBreakpoint lineBp = CDIDebugModel.createBlankAddressBreakpoint();
- Map<String, Object> attributes = new HashMap<String, Object>();
- CDIDebugModel.setAddressBreakpointAttributes(
- attributes, null, null, getBreakpointType(), -1, address, true, 0, "" ); //$NON-NLS-1$
- openBreakpointPropertiesDialog(lineBp, part, resource, attributes);
- }
+ @Override
+ protected void createAddressBreakpointInteractive(IWorkbenchPart part, IResource resource, IAddress address)
+ throws CoreException {
+ ICLineBreakpoint lineBp = CDIDebugModel.createBlankAddressBreakpoint();
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ CDIDebugModel.setAddressBreakpointAttributes(attributes, null, null, getBreakpointType(), -1, address, true, 0,
+ ""); //$NON-NLS-1$
+ openBreakpointPropertiesDialog(lineBp, part, resource, attributes);
+ }
protected int getBreakpointType() {
return ICBreakpointType.REGULAR;
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java
index ed71b276ce9..6b84831d599 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java
@@ -13,7 +13,7 @@
* Ericsson - DSF-GDB version
* Nokia - Made generic to DSF
*******************************************************************************/
-package org.eclipse.cdt.dsf.debug.internal.ui;
+package org.eclipse.cdt.dsf.debug.internal.ui;
import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
import org.eclipse.debug.ui.DebugUITools;
@@ -27,23 +27,23 @@ import org.eclipse.ui.IWindowListener;
import org.eclipse.ui.IWorkbench;
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", "Resume at Line",
* "Move to Line" and "Add Watch Expression" actions
- * visible in editors only if there is a running debug session.
+ * visible in editors only if there is a running debug session.
*/
public class EvaluationContextManager implements IWindowListener, IDebugContextListener {
- // Avoid referencing the cdt.debug.ui plugin for this constnat so that the
- // cdt.debug.ui is not automatically activated
- // Bug 343867.
- private static final String CDT_DEBUG_UI_PLUGIN_ID = "org.eclipse.cdt.debug.ui"; //$NON-NLS-1$
-
- // Must use the same ID than the base CDT uses since we want to enable actions that are registered by base CDT.
+ // Avoid referencing the cdt.debug.ui plugin for this constnat so that the
+ // cdt.debug.ui is not automatically activated
+ // Bug 343867.
+ private static final String CDT_DEBUG_UI_PLUGIN_ID = "org.eclipse.cdt.debug.ui"; //$NON-NLS-1$
+
+ // Must use the same ID than the base CDT uses since we want to enable actions that are registered by base CDT.
private final static String DEBUGGER_ACTIVE = CDT_DEBUG_UI_PLUGIN_ID + ".debuggerActive"; //$NON-NLS-1$
protected static EvaluationContextManager fgManager;
@@ -56,91 +56,91 @@ public class EvaluationContextManager implements IWindowListener, IDebugContextL
@Override
public void run() {
- if ( fgManager == null ) {
+ if (fgManager == null) {
// FindBugs reported that it is unsafe to set s_resources
// before we finish to initialize the object, because of
// multi-threading. This is why we use a temporary variable.
EvaluationContextManager manager = new EvaluationContextManager();
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- for( int i = 0; i < windows.length; i++ ) {
- manager.windowOpened( windows[i] );
+ for (int i = 0; i < windows.length; i++) {
+ manager.windowOpened(windows[i]);
}
- workbench.addWindowListener( manager );
-
+ workbench.addWindowListener(manager);
+
fgManager = manager;
}
}
};
Display display = Display.getCurrent();
- if ( display == null )
+ if (display == null)
display = Display.getDefault();
- display.asyncExec( r );
+ display.asyncExec(r);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
*/
@Override
- public void windowActivated( IWorkbenchWindow window ) {
- IDebugContextService service = DebugUITools.getDebugContextManager().getContextService(window);
- service.addDebugContextListener(this);
- selectionChanged( service.getActiveContext() );
+ public void windowActivated(IWorkbenchWindow window) {
+ IDebugContextService service = DebugUITools.getDebugContextManager().getContextService(window);
+ service.addDebugContextListener(this);
+ selectionChanged(service.getActiveContext());
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
*/
@Override
- public void windowDeactivated( IWorkbenchWindow window ) {
- DebugUITools.getDebugContextManager().getContextService(window).removeDebugContextListener(this);
+ public void windowDeactivated(IWorkbenchWindow window) {
+ DebugUITools.getDebugContextManager().getContextService(window).removeDebugContextListener(this);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
*/
@Override
- public void windowClosed( IWorkbenchWindow window ) {
+ public void windowClosed(IWorkbenchWindow window) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
*/
@Override
- public void windowOpened( IWorkbenchWindow window ) {
+ public void windowOpened(IWorkbenchWindow window) {
}
@Override
public void debugContextChanged(DebugContextEvent event) {
- selectionChanged(event.getContext());
+ selectionChanged(event.getContext());
}
-
- private void selectionChanged(ISelection selection ) {
- if ( selection instanceof IStructuredSelection ) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- if ( ss.size() == 1 ) {
- Object element = ss.getFirstElement();
- if ( element instanceof IDMVMContext ) {
- setContext( (IDMVMContext)element );
- return;
- }
- }
- }
- // no context in the given view
- removeContext();
+
+ private void selectionChanged(ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) selection;
+ if (ss.size() == 1) {
+ Object element = ss.getFirstElement();
+ if (element instanceof IDMVMContext) {
+ setContext((IDMVMContext) element);
+ return;
+ }
+ }
+ }
+ // no context in the given view
+ removeContext();
}
/**
* Sets the evaluation context.
*/
- private void setContext( IDMVMContext target ) {
- System.setProperty( DEBUGGER_ACTIVE, Boolean.TRUE.toString() );
+ private void setContext(IDMVMContext target) {
+ System.setProperty(DEBUGGER_ACTIVE, Boolean.TRUE.toString());
}
/**
* Removes an evaluation context.
*/
private void removeContext() {
- System.setProperty( DEBUGGER_ACTIVE, Boolean.FALSE.toString() );
+ System.setProperty(DEBUGGER_ACTIVE, Boolean.FALSE.toString());
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
index 1dd13b82c16..76477e9124c 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
@@ -59,44 +59,45 @@ import org.eclipse.ui.IWorkbenchPartSite;
/**
* Creates an information control to display an expression in a hover control.
* <br/> This class is derivative work from JDT's <code>ExpressionInformationControlCreator</code>.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
- *
+ *
* @since 2.1
*/
@SuppressWarnings("restriction")
public class ExpressionInformationControlCreator implements IInformationControlCreator {
- /**
- * A presentation context for the expression hover control.
- * Implements equals and hashCode based on id comparison.
- */
- private static final class ExpressionHoverPresentationContext extends PresentationContext {
-
- private ExpressionHoverPresentationContext(String id) {
- super(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof ExpressionHoverPresentationContext) {
- if (getId().equals(((PresentationContext) obj).getId())) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return getId().hashCode();
- }
- }
-
- class ExpressionInformationControl extends AbstractInformationControl implements IInformationControlExtension2, IViewerInputRequestor {
+ /**
+ * A presentation context for the expression hover control.
+ * Implements equals and hashCode based on id comparison.
+ */
+ private static final class ExpressionHoverPresentationContext extends PresentationContext {
+
+ private ExpressionHoverPresentationContext(String id) {
+ super(id);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof ExpressionHoverPresentationContext) {
+ if (getId().equals(((PresentationContext) obj).getId())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return getId().hashCode();
+ }
+ }
+
+ class ExpressionInformationControl extends AbstractInformationControl
+ implements IInformationControlExtension2, IViewerInputRequestor {
/**
* Dialog setting key for height
@@ -104,7 +105,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
private static final String HEIGHT = "HEIGHT"; //$NON-NLS-1$
/**
- * Dialog setting key for width.
+ * Dialog setting key for width.
*/
private static final String WIDTH = "WIDTH"; //$NON-NLS-1$
@@ -116,7 +117,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/**
* Dialog setting key for details sash weight
*/
- private static final String SASH_WEIGHT_DETAILS = "SashWeightDetails"; //$NON-NLS-1$
+ private static final String SASH_WEIGHT_DETAILS = "SashWeightDetails"; //$NON-NLS-1$
/**
* Variable to display.
@@ -132,7 +133,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
private ViewerInputService fInputService;
- private IInformationControlCreator fInformationControlCreator;
+ private IInformationControlCreator fInformationControlCreator;
/**
* Inner class implementing IDetailPaneContainer methods. Handles changes to detail
@@ -153,14 +154,14 @@ public class ExpressionInformationControlCreator implements IInformationControlC
*/
@Override
public IStructuredSelection getCurrentSelection() {
- return (IStructuredSelection)fViewer.getSelection();
+ return (IStructuredSelection) fViewer.getSelection();
}
/*
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#refreshDetailPaneContents()
*/
@Override
- public void refreshDetailPaneContents() {
+ public void refreshDetailPaneContents() {
fDetailPane.display(getCurrentSelection());
}
@@ -185,8 +186,9 @@ public class ExpressionInformationControlCreator implements IInformationControlC
*/
@Override
public void paneChanged(String newPaneID) {
- if (DefaultDetailPane.ID.equals(newPaneID)){
- fDetailPane.getCurrentControl().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ if (DefaultDetailPane.ID.equals(newPaneID)) {
+ fDetailPane.getCurrentControl()
+ .setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
}
}
@@ -194,7 +196,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/**
* Constructs a new control in the given shell.
- *
+ *
* @param parentShell shell
* @param resize whether resize is supported
*/
@@ -212,7 +214,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
// Bug 417559: The TextViewerHoverManager constrains the size of a newly created
// ExpressionInformationControl by 100 chars by 12 chars (602x182). The control
// size can be expanded beyond that, however when re-created it will still be constrained.
- // By removing the constraint in the presence of a non-null IDialogSettings,
+ // By removing the constraint in the presence of a non-null IDialogSettings,
// the size gets restored properly even when previously expanded.
Point dialogSettingsSize = getDialogSettingsSize();
if (dialogSettingsSize != null) {
@@ -237,7 +239,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
if (x > 0) {
int y = getIntSetting(settings, HEIGHT);
if (y > 0) {
- return new Point(x,y);
+ return new Point(x, y);
}
}
}
@@ -247,16 +249,16 @@ public class ExpressionInformationControlCreator implements IInformationControlC
@Override
public void setSize(int width, int height) {
- if (!isResizable() && fDetailPaneComposite != null) {
- // add height of details pane
- height += fDetailPaneComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
- }
- super.setSize(width, height);
+ if (!isResizable() && fDetailPaneComposite != null) {
+ // add height of details pane
+ height += fDetailPaneComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
+ }
+ super.setSize(width, height);
}
/**
* Returns the dialog settings for this hover or <code>null</code> if none
- *
+ *
* @param create whether to create the settings
*/
private IDialogSettings getDialogSettings(boolean create) {
@@ -270,7 +272,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/**
* Returns an integer value in the given dialog settings or -1 if none.
- *
+ *
* @param settings dialog settings
* @param key key
* @return value or -1 if not present
@@ -291,7 +293,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
/**
* Persists dialog settings.
- *
+ *
* @param shell
*/
private void persistSettings(Shell shell) {
@@ -301,14 +303,13 @@ public class ExpressionInformationControlCreator implements IInformationControlC
Point size = shell.getSize();
settings.put(WIDTH, size.x);
settings.put(HEIGHT, size.y);
- int[] weights = fSashForm.getWeights();
- if (weights.length == 1) {
- settings.put(SASH_WEIGHT_TREE, weights[0]);
- }
- else if (weights.length == 2) {
- settings.put(SASH_WEIGHT_TREE, weights[0]);
- settings.put(SASH_WEIGHT_DETAILS, weights[1]);
- }
+ int[] weights = fSashForm.getWeights();
+ if (weights.length == 1) {
+ settings.put(SASH_WEIGHT_TREE, weights[0]);
+ } else if (weights.length == 2) {
+ settings.put(SASH_WEIGHT_TREE, weights[0]);
+ settings.put(SASH_WEIGHT_DETAILS, weights[1]);
+ }
}
}
}
@@ -337,10 +338,11 @@ public class ExpressionInformationControlCreator implements IInformationControlC
// update presentation context
AbstractDebugView view = getViewToEmulate();
- IPresentationContext context = new ExpressionHoverPresentationContext(IDsfDebugUIConstants.ID_EXPRESSION_HOVER);
+ IPresentationContext context = new ExpressionHoverPresentationContext(
+ IDsfDebugUIConstants.ID_EXPRESSION_HOVER);
if (view != null) {
// copy over properties
- IPresentationContext copy = ((TreeModelViewer)view.getViewer()).getPresentationContext();
+ IPresentationContext copy = ((TreeModelViewer) view.getViewer()).getPresentationContext();
try {
String[] properties = copy.getProperties();
for (int i = 0; i < properties.length; i++) {
@@ -354,7 +356,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
fViewer = new TreeModelViewer(fSashForm, SWT.MULTI | SWT.VIRTUAL | SWT.FULL_SELECTION, context);
fViewer.setAutoExpandLevel(fExpansionLevel);
-
+
if (view != null) {
// copy over filters
StructuredViewer structuredViewer = (StructuredViewer) view.getViewer();
@@ -366,38 +368,40 @@ public class ExpressionInformationControlCreator implements IInformationControlC
}
}
fInputService = new ViewerInputService(fViewer, this);
- fTree = fViewer.getTree();
-
- if (fShowDetailPane) {
- fDetailPaneComposite = SWTFactory.createComposite(fSashForm, 1, 1, GridData.FILL_BOTH);
- Layout layout = fDetailPaneComposite.getLayout();
- if (layout instanceof GridLayout) {
- GridLayout gl = (GridLayout) layout;
- gl.marginHeight = 0;
- gl.marginWidth = 0;
- }
-
- fDetailPane = new DetailPaneProxy(new DetailPaneContainer());
- fDetailPane.display(null); // Bring up the default pane so the user doesn't see an empty composite
-
- fTree.addSelectionListener(new SelectionListener() {
- @Override
+ fTree = fViewer.getTree();
+
+ if (fShowDetailPane) {
+ fDetailPaneComposite = SWTFactory.createComposite(fSashForm, 1, 1, GridData.FILL_BOTH);
+ Layout layout = fDetailPaneComposite.getLayout();
+ if (layout instanceof GridLayout) {
+ GridLayout gl = (GridLayout) layout;
+ gl.marginHeight = 0;
+ gl.marginWidth = 0;
+ }
+
+ fDetailPane = new DetailPaneProxy(new DetailPaneContainer());
+ fDetailPane.display(null); // Bring up the default pane so the user doesn't see an empty composite
+
+ fTree.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
- fDetailPane.display((IStructuredSelection)fViewer.getSelection());
- }
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- }
-
+ fDetailPane.display((IStructuredSelection) fViewer.getSelection());
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ }
+
initSashWeights();
// add update listener to auto-select and display details of root expression
fViewerUpdateListener = new IViewerUpdateListener() {
@Override
public void viewerUpdatesComplete() {
- fViewer.getDisplay().timerExec(100, new Runnable() {
- @Override
+ fViewer.getDisplay().timerExec(100, new Runnable() {
+ @Override
public void run() {
if (!fViewer.getTree().isDisposed()) {
TreeSelection selection = (TreeSelection) fViewer.getSelection();
@@ -412,24 +416,26 @@ public class ExpressionInformationControlCreator implements IInformationControlC
}
});
}
+
@Override
public void viewerUpdatesBegin() {
}
+
@Override
public void updateStarted(IViewerUpdate update) {
}
+
@Override
public void updateComplete(IViewerUpdate update) {
}
};
-
+
fViewer.addViewerUpdateListener(fViewerUpdateListener);
- setForegroundColor(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
+ setForegroundColor(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
setBackgroundColor(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
}
-
/**
* Attempts to find an appropriate view to emulate, this will either be the
* variables view or the expressions view.
@@ -449,45 +455,44 @@ public class ExpressionInformationControlCreator implements IInformationControlC
return expressionsView;
}
return variablesView;
- }
+ }
/**
- * Initializes the sash form weights from the preference store (using default values if
+ * Initializes the sash form weights from the preference store (using default values if
* no sash weights were stored previously).
*/
- protected void initSashWeights(){
+ protected void initSashWeights() {
IDialogSettings settings = getDialogSettings(false);
if (settings != null) {
int tree = getIntSetting(settings, SASH_WEIGHT_TREE);
if (tree > 0) {
- if (fDetailPane != null) {
- int details = getIntSetting(settings, SASH_WEIGHT_DETAILS);
- if (details <= 0) {
- details = tree / 2;
- }
- fSashForm.setWeights(new int[]{tree, details});
- }
- else {
- fSashForm.setWeights(new int[]{tree});
- }
+ if (fDetailPane != null) {
+ int details = getIntSetting(settings, SASH_WEIGHT_DETAILS);
+ if (details <= 0) {
+ details = tree / 2;
+ }
+ fSashForm.setWeights(new int[] { tree, details });
+ } else {
+ fSashForm.setWeights(new int[] { tree });
+ }
}
}
}
- @Override
- public void setForegroundColor(Color foreground) {
- super.setForegroundColor(foreground);
- if (fDetailPaneComposite != null) {
- fDetailPaneComposite.setForeground(foreground);
- }
- fTree.setForeground(foreground);
- }
+ @Override
+ public void setForegroundColor(Color foreground) {
+ super.setForegroundColor(foreground);
+ if (fDetailPaneComposite != null) {
+ fDetailPaneComposite.setForeground(foreground);
+ }
+ fTree.setForeground(foreground);
+ }
- @Override
+ @Override
public void setBackgroundColor(Color background) {
super.setBackgroundColor(background);
if (fDetailPaneComposite != null) {
- fDetailPaneComposite.setBackground(background);
+ fDetailPaneComposite.setBackground(background);
}
fTree.setBackground(background);
}
@@ -519,14 +524,14 @@ public class ExpressionInformationControlCreator implements IInformationControlC
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
- if (fInformationControlCreator == null) {
- fInformationControlCreator = new ExpressionInformationControlCreator(fShowDetailPane, fExpansionLevel) {
- @Override
- public IInformationControl createInformationControl(Shell shell) {
- return new ExpressionInformationControl(shell, true);
- }
- };
- }
+ if (fInformationControlCreator == null) {
+ fInformationControlCreator = new ExpressionInformationControlCreator(fShowDetailPane, fExpansionLevel) {
+ @Override
+ public IInformationControl createInformationControl(Shell shell) {
+ return new ExpressionInformationControl(shell, true);
+ }
+ };
+ }
return fInformationControlCreator;
}
@@ -537,31 +542,31 @@ public class ExpressionInformationControlCreator implements IInformationControlC
}
- protected final boolean fShowDetailPane;
- protected final int fExpansionLevel;
+ protected final boolean fShowDetailPane;
+ protected final int fExpansionLevel;
- /**
- * Create default expression information control creator.
- * <p>
- * Same as {@code ExpressionInformationControlCreator(true, 1)}.
- * </p>
- */
- public ExpressionInformationControlCreator() {
- this(true, 1);
- }
+ /**
+ * Create default expression information control creator.
+ * <p>
+ * Same as {@code ExpressionInformationControlCreator(true, 1)}.
+ * </p>
+ */
+ public ExpressionInformationControlCreator() {
+ this(true, 1);
+ }
/**
* Create expression information control creator with customization options.
- *
- * @param showDetailPane if <code>true</code> the detail pane will be shown
- * @param expansionLevel tree level to which the expression should be expanded by default
- */
- public ExpressionInformationControlCreator(boolean showDetailPane, int expansionLevel) {
- fShowDetailPane = showDetailPane;
- fExpansionLevel = expansionLevel;
- }
-
- /*
+ *
+ * @param showDetailPane if <code>true</code> the detail pane will be shown
+ * @param expansionLevel tree level to which the expression should be expanded by default
+ */
+ public ExpressionInformationControlCreator(boolean showDetailPane, int expansionLevel) {
+ fShowDetailPane = showDetailPane;
+ fExpansionLevel = expansionLevel;
+ }
+
+ /*
* @see org.eclipse.jface.text.IInformationControlCreator#createInformationControl(org.eclipse.swt.widgets.Shell)
*/
@Override
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IDsfDebugHelpContextIds.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IDsfDebugHelpContextIds.java
index 27e80c88b2c..3ee26010a6c 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IDsfDebugHelpContextIds.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IDsfDebugHelpContextIds.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -20,16 +20,16 @@ import org.eclipse.debug.ui.IDebugUIConstants;
*/
public interface IDsfDebugHelpContextIds {
- public static final String PREFIX = IDebugUIConstants.PLUGIN_ID + "."; //$NON-NLS-1$
+ public static final String PREFIX = IDebugUIConstants.PLUGIN_ID + "."; //$NON-NLS-1$
- public static final String DETAIL_PANE = PREFIX + "detail_pane_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_ASSIGN_VALUE_ACTION = PREFIX + "detail_pane_assign_value_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_CONTENT_ASSIST_ACTION = PREFIX + "detail_pane_content_assist_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_CUT_ACTION = PREFIX + "detail_pane_cut_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_COPY_ACTION = PREFIX + "detail_pane_copy_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_PASTE_ACTION = PREFIX + "detail_pane_paste_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_SELECT_ALL_ACTION = PREFIX + "detail_pane_select_all_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_FIND_REPLACE_ACTION = PREFIX + "detail_pane_find_replace_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_WORD_WRAP_ACTION = PREFIX + "detail_pane_word_wrap_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_MAX_LENGTH_ACTION = PREFIX + "detail_pane_max_length_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE = PREFIX + "detail_pane_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_ASSIGN_VALUE_ACTION = PREFIX + "detail_pane_assign_value_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_CONTENT_ASSIST_ACTION = PREFIX + "detail_pane_content_assist_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_CUT_ACTION = PREFIX + "detail_pane_cut_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_COPY_ACTION = PREFIX + "detail_pane_copy_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_PASTE_ACTION = PREFIX + "detail_pane_paste_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_SELECT_ALL_ACTION = PREFIX + "detail_pane_select_all_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_FIND_REPLACE_ACTION = PREFIX + "detail_pane_find_replace_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_WORD_WRAP_ACTION = PREFIX + "detail_pane_word_wrap_action_context"; //$NON-NLS-1$
+ public static final String DETAIL_PANE_MAX_LENGTH_ACTION = PREFIX + "detail_pane_max_length_action_context"; //$NON-NLS-1$
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IInternalDsfDebugUIConstants.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IInternalDsfDebugUIConstants.java
index 2cb2da5ae7b..f399a4fadff 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IInternalDsfDebugUIConstants.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/IInternalDsfDebugUIConstants.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -19,10 +19,10 @@ import org.eclipse.cdt.dsf.debug.ui.IDsfDebugUIConstants;
* @since 2.0
*/
public interface IInternalDsfDebugUIConstants {
- /**
- * Boolean preference controlling whether the text in the detail panes is
- * wrapped. When <code>true</code> the text in the detail panes will be
- * wrapped in new variable view.
- */
- public static final String PREF_DETAIL_PANE_WORD_WRAP = IDsfDebugUIConstants.PLUGIN_ID + ".detail_pane_word_wrap"; //$NON-NLS-1$
+ /**
+ * Boolean preference controlling whether the text in the detail panes is
+ * wrapped. When <code>true</code> the text in the detail panes will be
+ * wrapped in new variable view.
+ */
+ public static final String PREF_DETAIL_PANE_WORD_WRAP = IDsfDebugUIConstants.PLUGIN_ID + ".detail_pane_word_wrap"; //$NON-NLS-1$
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/Messages.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/Messages.java
index 3874a800b09..d2f65542959 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/Messages.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/Messages.java
@@ -10,7 +10,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
- * Patrick Chuong (Texas Instruments) - Bug 315446: Invalid event breakpoint type (group) name
+ * Patrick Chuong (Texas Instruments) - Bug 315446: Invalid event breakpoint type (group) name
* Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865)
* Alvaro Sanchez-Leon (Ericsson AB) - Support Register Groups (Bug 235747)
*******************************************************************************/
@@ -30,7 +30,7 @@ public class Messages extends NLS {
public static String RegisterGroupConfirmRestoreMessage;
public static String RegisterGroupRestore;
public static String RegisterGroupRestoreCancel;
-
+
static {
// initialize resource bundle
NLS.initializeMessages(Messages.class.getName(), Messages.class);
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/PreferenceInitializer.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/PreferenceInitializer.java
index 076406f6b5a..4c5e3c3005f 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/PreferenceInitializer.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/PreferenceInitializer.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -29,10 +29,10 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
*/
@Override
public void initializeDefaultPreferences() {
-
+
IPreferenceStore prefs = DsfUIPlugin.getDefault().getPreferenceStore();
- /*
+ /*
* Debug View
*/
prefs.setDefault(IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT, 10);
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/SuspendResumeAdapterFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/SuspendResumeAdapterFactory.java
index 516ff73a02f..7441c631f79 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/SuspendResumeAdapterFactory.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/SuspendResumeAdapterFactory.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* Ericsson - Updated to support Move-To-Line
@@ -29,73 +29,84 @@ import org.eclipse.debug.core.model.ISuspendResume;
/**
* Adapter factory for Run-To-Line, Move-To-Line
* and Resume-At-Line
- *
+ *
* @since 2.1
*/
public class SuspendResumeAdapterFactory implements IAdapterFactory {
- static class SuspendResume implements ISuspendResume, IAdaptable {
+ static class SuspendResume implements ISuspendResume, IAdaptable {
+
+ private final RunToLine fRunToLine;
+ private final MoveToLine fMoveToLine;
+ private final ResumeAtLine fResumeAtLine;
+
+ SuspendResume(IExecutionDMContext execCtx) {
+ fRunToLine = new RunToLine(execCtx);
+ fMoveToLine = new MoveToLine(execCtx);
+ fResumeAtLine = new ResumeAtLine(execCtx);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> T getAdapter(Class<T> adapter) {
+ if (adapter.isInstance(fRunToLine)) {
+ return (T) fRunToLine;
+ }
+ if (adapter.isInstance(fMoveToLine)) {
+ return (T) fMoveToLine;
+ }
+ if (adapter.isInstance(fResumeAtLine)) {
+ return (T) fResumeAtLine;
+ }
+ return null;
+ }
+
+ @Override
+ public boolean canResume() {
+ return false;
+ }
- private final RunToLine fRunToLine;
- private final MoveToLine fMoveToLine;
- private final ResumeAtLine fResumeAtLine;
-
- SuspendResume(IExecutionDMContext execCtx) {
- fRunToLine = new RunToLine(execCtx);
- fMoveToLine = new MoveToLine(execCtx);
- fResumeAtLine = new ResumeAtLine(execCtx);
- }
-
- @SuppressWarnings("unchecked")
@Override
- public <T> T getAdapter(Class<T> adapter) {
- if (adapter.isInstance(fRunToLine)) {
- return (T)fRunToLine;
- }
- if (adapter.isInstance(fMoveToLine)) {
- return (T)fMoveToLine;
- }
- if (adapter.isInstance(fResumeAtLine)) {
- return (T)fResumeAtLine;
- }
- return null;
- }
+ public boolean canSuspend() {
+ return false;
+ }
- @Override
- public boolean canResume() { return false; }
- @Override
- public boolean canSuspend() { return false; }
- // This must return true because the platform
- // RunToLineActionDelegate will only enable the
- // action if we are suspended
- @Override
- public boolean isSuspended() { return true; }
- @Override
- public void resume() throws DebugException {}
- @Override
- public void suspend() throws DebugException {}
- }
-
- @SuppressWarnings("unchecked")
+ // This must return true because the platform
+ // RunToLineActionDelegate will only enable the
+ // action if we are suspended
+ @Override
+ public boolean isSuspended() {
+ return true;
+ }
+
+ @Override
+ public void resume() throws DebugException {
+ }
+
+ @Override
+ public void suspend() throws DebugException {
+ }
+ }
+
+ @SuppressWarnings("unchecked")
@Override
- public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
- if (ISuspendResume.class.equals(adapterType)) {
- if (adaptableObject instanceof IDMVMContext) {
- IExecutionDMContext execDmc = DMContexts.getAncestorOfType(
- ((IDMVMContext)adaptableObject).getDMContext(),
- IExecutionDMContext.class);
- // It only makes sense to RunToLine, MoveToLine or
- // ResumeAtLine if we are dealing with a thread, not a container
- if (execDmc != null && !(execDmc instanceof IContainerDMContext)) {
- return (T)new SuspendResume(execDmc);
- }
- }
- }
- return null;
- }
+ public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
+ if (ISuspendResume.class.equals(adapterType)) {
+ if (adaptableObject instanceof IDMVMContext) {
+ IExecutionDMContext execDmc = DMContexts
+ .getAncestorOfType(((IDMVMContext) adaptableObject).getDMContext(), IExecutionDMContext.class);
+ // It only makes sense to RunToLine, MoveToLine or
+ // ResumeAtLine if we are dealing with a thread, not a container
+ if (execDmc != null && !(execDmc instanceof IContainerDMContext)) {
+ return (T) new SuspendResume(execDmc);
+ }
+ }
+ }
+ return null;
+ }
- @Override
- public Class<?>[] getAdapterList() {
- return new Class[] { ISuspendResume.class };
- }
+ @Override
+ public Class<?>[] getAdapterList() {
+ return new Class[] { ISuspendResume.class };
+ }
} \ No newline at end of file
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java
index 2e6648be19a..7d8b2bfe4e4 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ToggleBreakpointsTargetFactory.java
@@ -52,7 +52,7 @@ public class ToggleBreakpointsTargetFactory implements IToggleBreakpointsTargetF
* for the editor.
*/
public static final String TOGGLE_C_BREAKPOINT_TARGET_ID = CDebugUIPlugin.PLUGIN_ID + ".toggleCBreakpointTarget"; //$NON-NLS-1$
-
+
private static final Set<String> TOGGLE_TARGET_IDS = new HashSet<String>(1);
static {
TOGGLE_TARGET_IDS.add(TOGGLE_C_BREAKPOINT_TARGET_ID);
@@ -63,7 +63,7 @@ public class ToggleBreakpointsTargetFactory implements IToggleBreakpointsTargetF
public ToggleBreakpointsTargetFactory() {
}
- @Override
+ @Override
public IToggleBreakpointsTarget createToggleTarget(String targetID) {
if (TOGGLE_C_BREAKPOINT_TARGET_ID.equals(targetID)) {
return fgDisassemblyToggleBreakpointsTarget;
@@ -71,45 +71,43 @@ public class ToggleBreakpointsTargetFactory implements IToggleBreakpointsTargetF
return null;
}
- @Override
+ @Override
public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
if (part instanceof IDisassemblyPart) {
- // Return the debug context as a default if the currently selected context
- // is a CDT element. Otherwise return null.
- Object element = getDebugContext(part).getFirstElement();
- if (element instanceof IAdaptable) {
- IDebugModelProvider modelProvider =
- ((IAdaptable)element).getAdapter(IDebugModelProvider.class);
- if (modelProvider != null) {
- String[] models = modelProvider.getModelIdentifiers();
- for (String model : models) {
- if (CDIDebugModel.getPluginIdentifier().equals(model) ||
- ICBreakpoint.C_BREAKPOINTS_DEBUG_MODEL_ID.equals(model))
- {
- return TOGGLE_C_BREAKPOINT_TARGET_ID;
- }
- }
- } else if (element instanceof IDebugElement) {
- if (CDIDebugModel.getPluginIdentifier().equals(((IDebugElement)element).getModelIdentifier()) ) {
- return TOGGLE_C_BREAKPOINT_TARGET_ID;
- }
- }
- }
+ // Return the debug context as a default if the currently selected context
+ // is a CDT element. Otherwise return null.
+ Object element = getDebugContext(part).getFirstElement();
+ if (element instanceof IAdaptable) {
+ IDebugModelProvider modelProvider = ((IAdaptable) element).getAdapter(IDebugModelProvider.class);
+ if (modelProvider != null) {
+ String[] models = modelProvider.getModelIdentifiers();
+ for (String model : models) {
+ if (CDIDebugModel.getPluginIdentifier().equals(model)
+ || ICBreakpoint.C_BREAKPOINTS_DEBUG_MODEL_ID.equals(model)) {
+ return TOGGLE_C_BREAKPOINT_TARGET_ID;
+ }
+ }
+ } else if (element instanceof IDebugElement) {
+ if (CDIDebugModel.getPluginIdentifier().equals(((IDebugElement) element).getModelIdentifier())) {
+ return TOGGLE_C_BREAKPOINT_TARGET_ID;
+ }
+ }
+ }
}
return null;
}
- @Override
+ @Override
public String getToggleTargetDescription(String targetID) {
return Messages.ToggleBreakpointsTargetFactory_description;
}
- @Override
+ @Override
public String getToggleTargetName(String targetID) {
return Messages.ToggleBreakpointsTargetFactory_name;
}
- @Override
+ @Override
public Set<String> getToggleTargets(IWorkbenchPart part, ISelection selection) {
if (part instanceof IDisassemblyPart) {
return TOGGLE_TARGET_IDS;
@@ -118,11 +116,11 @@ public class ToggleBreakpointsTargetFactory implements IToggleBreakpointsTargetF
}
private IStructuredSelection getDebugContext(IWorkbenchPart part) {
- ISelection selection = DebugUITools.getDebugContextManager().
- getContextService(part.getSite().getWorkbenchWindow()).getActiveContext();
+ ISelection selection = DebugUITools.getDebugContextManager()
+ .getContextService(part.getSite().getWorkbenchWindow()).getActiveContext();
if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection)selection;
- }
+ return (IStructuredSelection) selection;
+ }
return StructuredSelection.EMPTY;
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java
index 9c0f97370a3..4eeeadfa6c0 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java
@@ -176,24 +176,25 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
protected void addRegisterGroup(final IWorkbenchPart part, final IStructuredSelection selection) {
try {
- final SelectionDMContext selectionContext = new SelectionDMContext(selection);
- selectionContext.fsession.getExecutor().execute(new DsfRunnable() {
+ final SelectionDMContext selectionContext = new SelectionDMContext(selection);
+ selectionContext.fsession.getExecutor().execute(new DsfRunnable() {
- @Override
- public void run() {
- final IRegisters2 registersService;
- try {
- registersService = selectionContext.resolveService();
- } catch (CoreException e) {
- failed(e);
- return;
+ @Override
+ public void run() {
+ final IRegisters2 registersService;
+ try {
+ registersService = selectionContext.resolveService();
+ } catch (CoreException e) {
+ failed(e);
+ return;
+ }
+
+ // continue to process
+ processAddRegisterGroup(part.getSite().getShell(), selectionContext,
+ resolveSelectedRegisters(selection), registersService);
}
+ });
- // continue to process
- processAddRegisterGroup(part.getSite().getShell(), selectionContext,
- resolveSelectedRegisters(selection), registersService);
- }});
-
} catch (DebugException e) {
}
}
@@ -234,27 +235,26 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
protected void editRegisterGroup(final IWorkbenchPart part, IStructuredSelection selection) {
try {
- final SelectionDMContext selectionContext = new SelectionDMContext(selection);
-
- selectionContext.fsession.getExecutor().execute(new DsfRunnable() {
- @Override
- public void run() {
- // Create a services tracker
- final IRegisters2 registersService;
- try {
- registersService = selectionContext.resolveService();
- } catch (CoreException e) {
- failed(e);
- return;
+ final SelectionDMContext selectionContext = new SelectionDMContext(selection);
+
+ selectionContext.fsession.getExecutor().execute(new DsfRunnable() {
+ @Override
+ public void run() {
+ // Create a services tracker
+ final IRegisters2 registersService;
+ try {
+ registersService = selectionContext.resolveService();
+ } catch (CoreException e) {
+ failed(e);
+ return;
+ }
+
+ processEditRegisterGroup(part.getSite().getShell(), selectionContext, registersService);
}
-
- processEditRegisterGroup(part.getSite().getShell(), selectionContext,
- registersService);
- }
-
- });
- } catch (DebugException e) {
- }
+
+ });
+ } catch (DebugException e) {
+ }
}
protected boolean canEditRegisterGroup(IWorkbenchPart part, IStructuredSelection selection) {
@@ -304,24 +304,25 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
*/
protected void removeRegisterGroups(IWorkbenchPart part, IStructuredSelection selection) {
try {
- final SelectionDMContext selectionContext = new SelectionDMContext(selection);
-
- final IRegisterGroupDMContext[] groups = resolveSelectedGroups(selection);
- selectionContext.fsession.getExecutor().execute(new DsfRunnable() {
- @Override
- public void run() {
- IRegisters2 registersService;
- try {
- registersService = selectionContext.resolveService();
- } catch (CoreException e) {
- failed(e);
- return;
- }
+ final SelectionDMContext selectionContext = new SelectionDMContext(selection);
- registersService.removeRegisterGroups(groups, new RequestMonitor(registersService.getExecutor(), null) {
- });
- }
- });
+ final IRegisterGroupDMContext[] groups = resolveSelectedGroups(selection);
+ selectionContext.fsession.getExecutor().execute(new DsfRunnable() {
+ @Override
+ public void run() {
+ IRegisters2 registersService;
+ try {
+ registersService = selectionContext.resolveService();
+ } catch (CoreException e) {
+ failed(e);
+ return;
+ }
+
+ registersService.removeRegisterGroups(groups,
+ new RequestMonitor(registersService.getExecutor(), null) {
+ });
+ }
+ });
} catch (DebugException e) {
}
}
@@ -337,13 +338,13 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
// No DM context present or group registers service found in the selection
return false;
}
-
+
//resolve the selected groups
final IRegisterGroupDMContext[] groups = resolveSelectedGroups(selection);
- if (groups == null || groups.length < 1){
+ if (groups == null || groups.length < 1) {
return false;
}
-
+
//Prepare to Query the service and check if the selected groups can be removed
Query<Boolean> query = new Query<Boolean>() {
@Override
@@ -357,11 +358,11 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
rm.done();
return;
}
-
+
regService.canRemoveRegisterGroups(groups, rm);
}
};
-
+
//Execute the query
selectionContext.fsession.getExecutor().execute(query);
@@ -371,7 +372,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
} catch (InterruptedException e) {
} catch (ExecutionException e) {
}
-
+
// No positive answer from the service
return false;
}
@@ -399,7 +400,8 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
}
// no success handler needed
- registersService.restoreDefaultGroups(null, new RequestMonitor(registersService.getExecutor(), null));
+ registersService.restoreDefaultGroups(null,
+ new RequestMonitor(registersService.getExecutor(), null));
}
});
} catch (DebugException e) {
@@ -418,7 +420,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
// No DM context present or group registers service found in the selection
return false;
}
-
+
//Prepare to Query the service
Query<Boolean> query = new Query<Boolean>() {
@Override
@@ -432,11 +434,11 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
rm.done();
return;
}
-
+
regService.canRestoreDefaultGroups(selectionContext.fcontext, rm);
}
};
-
+
//Execute the query
selectionContext.fsession.getExecutor().execute(query);
@@ -446,100 +448,106 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
} catch (InterruptedException e) {
} catch (ExecutionException e) {
}
-
+
// No positive answer from the service
return false;
}
@ConfinedToDsfExecutor("selectionContext.fsession.getExecutor()")
- private void processAddRegisterGroup(final Shell shell, final SelectionDMContext selectionContext, final IRegisterDMContext[] selectedRegisters,
- final IRegisters2 regServiceManager) {
+ private void processAddRegisterGroup(final Shell shell, final SelectionDMContext selectionContext,
+ final IRegisterDMContext[] selectedRegisters, final IRegisters2 regServiceManager) {
final DsfSession session = selectionContext.fsession;
final DsfExecutor executor = session.getExecutor();
- final IContainerDMContext contDmc = DMContexts.getAncestorOfType(selectionContext.fcontext, IContainerDMContext.class);
- // Using the container context to get all existing registers from the target instead of a limited set of registers for a selected group
- regServiceManager.getRegisters(contDmc, new DataRequestMonitor<IRegisterDMContext[]>(
- executor, null) {
-
+ final IContainerDMContext contDmc = DMContexts.getAncestorOfType(selectionContext.fcontext,
+ IContainerDMContext.class);
+ // Using the container context to get all existing registers from the target instead of a limited set of registers for a selected group
+ regServiceManager.getRegisters(contDmc, new DataRequestMonitor<IRegisterDMContext[]>(executor, null) {
+
@Override
protected void handleSuccess() {
// Get Register Contexts
final IRegisterDMContext[] rootRegisters = getData();
-
+
if (rootRegisters.length < 1) {
//The target is expected to have registers, an error has happened !
assert false;
noRegisterGroupFoundErr("Add Register Group", this); //$NON-NLS-1$
return;
}
-
+
//Find the root register group, containing all the registers associated to a target, from any of the root registers
- final IRegisterGroupDMContext rootGroupDmc = DMContexts.getAncestorOfType(rootRegisters[0], IRegisterGroupDMContext.class);
+ final IRegisterGroupDMContext rootGroupDmc = DMContexts.getAncestorOfType(rootRegisters[0],
+ IRegisterGroupDMContext.class);
// Get data for all available registers
- getRegistersData(rootRegisters, regServiceManager, new DataRequestMonitor<IRegisterDMData[]>(executor, null) {
- @Override
- protected void handleSuccess() {
- final IRegisterDMData[] rootRegistersData = getData();
-
- getRegistersData(selectedRegisters, regServiceManager, new DataRequestMonitor<IRegisterDMData[]>(executor, null) {
+ getRegistersData(rootRegisters, regServiceManager,
+ new DataRequestMonitor<IRegisterDMData[]>(executor, null) {
@Override
protected void handleSuccess() {
- // Get data for all selected registers i.e. selected for the new group
- final IRegisterDMData[] selectedRegistersData = getData();
-
- //Need the root group name to build register descriptors
- regServiceManager.getRegisterGroupData(rootGroupDmc,
- new DataRequestMonitor<IRegisterGroupDMData>(executor, null) {
+ final IRegisterDMData[] rootRegistersData = getData();
+
+ getRegistersData(selectedRegisters, regServiceManager,
+ new DataRequestMonitor<IRegisterDMData[]>(executor, null) {
@Override
protected void handleSuccess() {
- final IRegisterGroupDMData rootGroupData = getData();
- // request for the next unused group name to propose it to the user
- proposeGroupName(rootRegisters, regServiceManager, new DataRequestMonitor<String>(executor, null) {
+ // Get data for all selected registers i.e. selected for the new group
+ final IRegisterDMData[] selectedRegistersData = getData();
+
+ //Need the root group name to build register descriptors
+ regServiceManager.getRegisterGroupData(rootGroupDmc,
+ new DataRequestMonitor<IRegisterGroupDMData>(executor, null) {
@Override
protected void handleSuccess() {
- String proposedGroupName = getData();
-
- String rootGroupName = (rootGroupData == null) ? BLANK_STRING
- : rootGroupData.getName();
- // Create the Register descriptors
- DialogRegisterProvider descriptors = buildDescriptors(
- rootGroupName, rootRegisters,
- rootRegistersData,
- selectedRegistersData);
- // Create Dialog Resolve selection to DSF
- // Registers
- getDialogSelection(
- shell,
- proposedGroupName,
- descriptors.getAllRegisters(),
- descriptors.getcheckedRegisters(),
- new DataRequestMonitor<IRegisterGroupDescriptor>(
- executor, null) {
+ final IRegisterGroupDMData rootGroupData = getData();
+ // request for the next unused group name to propose it to the user
+ proposeGroupName(rootRegisters, regServiceManager,
+ new DataRequestMonitor<String>(executor, null) {
@Override
protected void handleSuccess() {
- try {
- addRegisterGroup(
- regServiceManager,
- getData(), contDmc);
- } catch (CoreException e) {
- failed(e);
- }
- };
+ String proposedGroupName = getData();
+
+ String rootGroupName = (rootGroupData == null)
+ ? BLANK_STRING
+ : rootGroupData.getName();
+ // Create the Register descriptors
+ DialogRegisterProvider descriptors = buildDescriptors(
+ rootGroupName, rootRegisters,
+ rootRegistersData,
+ selectedRegistersData);
+ // Create Dialog Resolve selection to DSF
+ // Registers
+ getDialogSelection(shell,
+ proposedGroupName,
+ descriptors.getAllRegisters(),
+ descriptors
+ .getcheckedRegisters(),
+ new DataRequestMonitor<IRegisterGroupDescriptor>(
+ executor, null) {
+ @Override
+ protected void handleSuccess() {
+ try {
+ addRegisterGroup(
+ regServiceManager,
+ getData(),
+ contDmc);
+ } catch (CoreException e) {
+ failed(e);
+ }
+ };
+ });
+ }
});
+
}
});
-
}
});
}
});
- }
- });
}
-
+
});
}
@@ -552,53 +560,57 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
rm.done();
}
- private void proposeGroupName(IRegisterDMContext[] registers, final IRegisters2 regServiceManager, final DataRequestMonitor<String> rm) {
- assert(registers != null && registers.length > 0);
-
+ private void proposeGroupName(IRegisterDMContext[] registers, final IRegisters2 regServiceManager,
+ final DataRequestMonitor<String> rm) {
+ assert (registers != null && registers.length > 0);
+
final DsfExecutor executor = regServiceManager.getExecutor();
if (registers != null && registers.length > 0) {
//First get all register group contexts, any register context can be used to resolve the container context
- regServiceManager.getRegisterGroups(registers[0], new DataRequestMonitor<IRegisterGroupDMContext[]>(executor, null) {
- @Override
- protected void handleSuccess() {
- IRegisterGroupDMContext[] groupsCtx = getData();
- assert (groupsCtx != null);
-
- final IRegisterGroupDMData[] groupsData = new IRegisterGroupDMData[groupsCtx.length];
-
- final CountingRequestMonitor crm = new CountingRequestMonitor(executor, rm) {
+ regServiceManager.getRegisterGroups(registers[0],
+ new DataRequestMonitor<IRegisterGroupDMContext[]>(executor, null) {
@Override
- protected void handleCompleted() {
- //GroupsData is resolved now
- //Select an unused name
- String unusedGroupName = Messages.ProposeGroupNameRoot + (resolveGroupNameWaterMark(groupsData) + 1);
- rm.setData(unusedGroupName);
- rm.done();
- }
- };
-
- //Resolve all register group data
- for (int i=0; i < groupsCtx.length; i++) {
- final int index = i;
- regServiceManager.getRegisterGroupData(groupsCtx[index], new DataRequestMonitor<IRegisterGroupDMData>(executor, crm){
- @Override
- protected void handleSuccess() {
- groupsData[index] = getData();
- crm.done();
+ protected void handleSuccess() {
+ IRegisterGroupDMContext[] groupsCtx = getData();
+ assert (groupsCtx != null);
+
+ final IRegisterGroupDMData[] groupsData = new IRegisterGroupDMData[groupsCtx.length];
+
+ final CountingRequestMonitor crm = new CountingRequestMonitor(executor, rm) {
+ @Override
+ protected void handleCompleted() {
+ //GroupsData is resolved now
+ //Select an unused name
+ String unusedGroupName = Messages.ProposeGroupNameRoot
+ + (resolveGroupNameWaterMark(groupsData) + 1);
+ rm.setData(unusedGroupName);
+ rm.done();
+ }
+ };
+
+ //Resolve all register group data
+ for (int i = 0; i < groupsCtx.length; i++) {
+ final int index = i;
+ regServiceManager.getRegisterGroupData(groupsCtx[index],
+ new DataRequestMonitor<IRegisterGroupDMData>(executor, crm) {
+ @Override
+ protected void handleSuccess() {
+ groupsData[index] = getData();
+ crm.done();
+ }
+ });
}
- });
- }
-
- crm.setDoneCount(groupsCtx.length);
- }
- });
+
+ crm.setDoneCount(groupsCtx.length);
+ }
+ });
} else {
//Should not happen
rm.setData(Messages.DefaultRegistersGroupName);
rm.done();
}
}
-
+
// Adjust water mark suffix used to suggest register group names
private Integer resolveGroupNameWaterMark(IRegisterGroupDMData[] groupsData) {
// check only for this name pattern
@@ -623,14 +635,15 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
// Quite unlikely and only causing a possibility to
// propose a group name that already exists.
}
- }
+ }
}
-
+
return Integer.valueOf(water_mark);
}
-
+
@ConfinedToDsfExecutor("selectionContext.fsession.getExecutor()")
- private void processEditRegisterGroup(final Shell shell, final SelectionDMContext selectionContext, final IRegisters2 regServiceManager) {
+ private void processEditRegisterGroup(final Shell shell, final SelectionDMContext selectionContext,
+ final IRegisters2 regServiceManager) {
final DsfSession session = selectionContext.fsession;
final DsfExecutor executor = session.getExecutor();
@@ -646,94 +659,110 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
protected void handleSuccess() {
// Get children Register Contexts
final IRegisterDMContext[] childRegisters = getData();
-
- final IContainerDMContext contDmc = DMContexts.getAncestorOfType(selectionContext.fcontext, IContainerDMContext.class);
- // Using the container context to get all existing registers from the target instead of a limited set of registers for a selected group
+
+ final IContainerDMContext contDmc = DMContexts.getAncestorOfType(selectionContext.fcontext,
+ IContainerDMContext.class);
+ // Using the container context to get all existing registers from the target instead of a limited set of registers for a selected group
// This is needed to populate the dialog with all available registers to pick from
- regServiceManager.getRegisters(contDmc, new DataRequestMonitor<IRegisterDMContext[]>(
- executor, null) {
- @Override
- protected void handleSuccess() {
- final IRegisterDMContext[] rootRegisters = getData();
-
- if (rootRegisters.length < 1) {
- //The target is expected to have a root register group and associated registers, an error has happened !
- assert false;
- noRegisterGroupFoundErr("Edit Register Group", this); //$NON-NLS-1$
- return;
- }
-
- // We need to resolve the names for all root registers
- getRegistersData(rootRegisters, regServiceManager, new DataRequestMonitor<IRegisterDMData[]>(executor, null) {
+ regServiceManager.getRegisters(contDmc,
+ new DataRequestMonitor<IRegisterDMContext[]>(executor, null) {
@Override
protected void handleSuccess() {
- final IRegisterDMData[] rootRegistersData = getData();
-
- getRegistersData(childRegisters, regServiceManager, new DataRequestMonitor<IRegisterDMData[]>(executor, null) {
- @Override
- protected void handleSuccess() {
- // Get register data for all selected registers i.e. selected for the new group
- final IRegisterDMData[] childRegisterData = getData();
-
- // Need to get the parent group name. Used on the register descriptors
- final IRegisterGroupDMContext rootGroupDmc = DMContexts.getAncestorOfType(rootRegisters[0], IRegisterGroupDMContext.class);
- regServiceManager.getRegisterGroupData(rootGroupDmc,
- new DataRequestMonitor<IRegisterGroupDMData>(
- executor, null) {
- @Override
- protected void handleSuccess() {
- IRegisterGroupDMData rootGroupData = getData();
- final String rootGroupName = (rootGroupData == null) ? BLANK_STRING
- : rootGroupData.getName();
-
- regServiceManager.getRegisterGroupData(groupDmc,
- new DataRequestMonitor<IRegisterGroupDMData>(
- executor, null) {
- @Override
- protected void handleSuccess() {
- // Resolve the name of the selected group being edited
- String selGroupName = getData().getName();
- // Create the Register descriptors to
- // access all children registers
- DialogRegisterProvider descriptors = buildDescriptors(
- rootGroupName, rootRegisters,
- rootRegistersData,
- childRegisterData);
-
- // Create Dialog to Resolve new user
- // selection of group name and registers
- getDialogSelection(
- shell,
- selGroupName,
- descriptors.getAllRegisters(),
- descriptors
- .getcheckedRegisters(),
- new DataRequestMonitor<IRegisterGroupDescriptor>(
- executor, null) {
- @Override
- protected void handleSuccess() {
- try {
- editRegisterGroup(
- groupDmc,
- regServiceManager,
- getData());
- } catch (CoreException e) {
- failed(e);
- }
- };
- });
- }
- });
- };
-
- });
- }
- });
-
+ final IRegisterDMContext[] rootRegisters = getData();
+
+ if (rootRegisters.length < 1) {
+ //The target is expected to have a root register group and associated registers, an error has happened !
+ assert false;
+ noRegisterGroupFoundErr("Edit Register Group", this); //$NON-NLS-1$
+ return;
+ }
+
+ // We need to resolve the names for all root registers
+ getRegistersData(rootRegisters, regServiceManager,
+ new DataRequestMonitor<IRegisterDMData[]>(executor, null) {
+ @Override
+ protected void handleSuccess() {
+ final IRegisterDMData[] rootRegistersData = getData();
+
+ getRegistersData(childRegisters, regServiceManager,
+ new DataRequestMonitor<IRegisterDMData[]>(executor,
+ null) {
+ @Override
+ protected void handleSuccess() {
+ // Get register data for all selected registers i.e. selected for the new group
+ final IRegisterDMData[] childRegisterData = getData();
+
+ // Need to get the parent group name. Used on the register descriptors
+ final IRegisterGroupDMContext rootGroupDmc = DMContexts
+ .getAncestorOfType(rootRegisters[0],
+ IRegisterGroupDMContext.class);
+ regServiceManager.getRegisterGroupData(
+ rootGroupDmc,
+ new DataRequestMonitor<IRegisterGroupDMData>(
+ executor, null) {
+ @Override
+ protected void handleSuccess() {
+ IRegisterGroupDMData rootGroupData = getData();
+ final String rootGroupName = (rootGroupData == null)
+ ? BLANK_STRING
+ : rootGroupData
+ .getName();
+
+ regServiceManager
+ .getRegisterGroupData(
+ groupDmc,
+ new DataRequestMonitor<IRegisterGroupDMData>(
+ executor,
+ null) {
+ @Override
+ protected void handleSuccess() {
+ // Resolve the name of the selected group being edited
+ String selGroupName = getData()
+ .getName();
+ // Create the Register descriptors to
+ // access all children registers
+ DialogRegisterProvider descriptors = buildDescriptors(
+ rootGroupName,
+ rootRegisters,
+ rootRegistersData,
+ childRegisterData);
+
+ // Create Dialog to Resolve new user
+ // selection of group name and registers
+ getDialogSelection(
+ shell,
+ selGroupName,
+ descriptors
+ .getAllRegisters(),
+ descriptors
+ .getcheckedRegisters(),
+ new DataRequestMonitor<IRegisterGroupDescriptor>(
+ executor,
+ null) {
+ @Override
+ protected void handleSuccess() {
+ try {
+ editRegisterGroup(
+ groupDmc,
+ regServiceManager,
+ getData());
+ } catch (CoreException e) {
+ failed(e);
+ }
+ };
+ });
+ }
+ });
+ };
+
+ });
+ }
+ });
+
+ }
+ });
}
});
- }
- });
}
});
}
@@ -799,9 +828,8 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
}
@ConfinedToDsfExecutor("selectionContext.fsession.getExecutor()")
- private void getDialogSelection(Shell shell, String originalGroupName,
- IRegisterDescriptor[] allRegisters, IRegisterDescriptor[] checkedRegisters,
- DataRequestMonitor<IRegisterGroupDescriptor> rm) {
+ private void getDialogSelection(Shell shell, String originalGroupName, IRegisterDescriptor[] allRegisters,
+ IRegisterDescriptor[] checkedRegisters, DataRequestMonitor<IRegisterGroupDescriptor> rm) {
RegisterGroupDialogRunnable dialog = new RegisterGroupDialogRunnable(shell, originalGroupName, allRegisters,
checkedRegisters, rm);
shell.getDisplay().asyncExec(dialog);
@@ -833,7 +861,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
/**
* Build descriptor adapters to dialog interface both all registers as well as registers to be pre-selected on the
* dialog
- *
+ *
* @param checkedRegistersData
*/
@ConfinedToDsfExecutor("selectionContext.fsession.getExecutor()")
@@ -885,24 +913,24 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
}
@ConfinedToDsfExecutor("selectionContext.fsession.getExecutor()")
- private void addRegisterGroup(IRegisters2 regServiceManager,
- IRegisterGroupDescriptor groupDescriptor, IContainerDMContext contDmc) throws CoreException {
+ private void addRegisterGroup(IRegisters2 regServiceManager, IRegisterGroupDescriptor groupDescriptor,
+ IContainerDMContext contDmc) throws CoreException {
IRegisterDescriptor[] selectedRegisters = groupDescriptor.getChildren();
if (selectedRegisters != null) {
String groupName = groupDescriptor.getName();
// Register the addition of the group and notify the change
IRegisterDMContext[] registers = getRegisterContexts(selectedRegisters);
- regServiceManager.addRegisterGroup(contDmc, groupName, registers, new RequestMonitor(
- regServiceManager.getSession().getExecutor(), null) {
- @Override
- protected void handleCompleted() {
- if (getStatus() != null && getStatus().getCode() == IDsfStatusConstants.NOT_SUPPORTED) {
- // This user request is not supported, notify the user
- notifyUser(getStatus().getMessage());
- }
+ regServiceManager.addRegisterGroup(contDmc, groupName, registers,
+ new RequestMonitor(regServiceManager.getSession().getExecutor(), null) {
+ @Override
+ protected void handleCompleted() {
+ if (getStatus() != null && getStatus().getCode() == IDsfStatusConstants.NOT_SUPPORTED) {
+ // This user request is not supported, notify the user
+ notifyUser(getStatus().getMessage());
+ }
- };
- });
+ };
+ });
}
}
@@ -915,15 +943,15 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
// Register the addition of the group and notify the change
regServiceManager.editRegisterGroup(group, groupName, getRegisterContexts(selectedRegisters),
new RequestMonitor(regServiceManager.getSession().getExecutor(), null) {
- @Override
- protected void handleCompleted() {
- if (getStatus() != null && getStatus().getCode() == IDsfStatusConstants.NOT_SUPPORTED) {
- // This user request is not supported, notify the user
- notifyUser(getStatus().getMessage());
- }
-
- };
- });
+ @Override
+ protected void handleCompleted() {
+ if (getStatus() != null && getStatus().getCode() == IDsfStatusConstants.NOT_SUPPORTED) {
+ // This user request is not supported, notify the user
+ notifyUser(getStatus().getMessage());
+ }
+
+ };
+ });
}
}
@@ -934,13 +962,14 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
}
private void notifyUser(final String message) {
-
+
Runnable runnable = new Runnable() {
@Override
public void run() {
Shell parent = DsfUIPlugin.getActiveWorkbenchShell();
if (parent != null) {
- MessageDialog.openInformation(parent, Messages.Information, Messages.RegisterGroupInfo + ": " + message); //$NON-NLS-1$
+ MessageDialog.openInformation(parent, Messages.Information,
+ Messages.RegisterGroupInfo + ": " + message); //$NON-NLS-1$
}
}
};
@@ -948,47 +977,47 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
Display.getDefault().asyncExec(runnable);
}
- /**
- * @return true - OK to restore
- */
- private boolean restoreConfirmed() {
- ConfirmRestoreDialog restoreDialog = new ConfirmRestoreDialog();
+ /**
+ * @return true - OK to restore
+ */
+ private boolean restoreConfirmed() {
+ ConfirmRestoreDialog restoreDialog = new ConfirmRestoreDialog();
Display.getDefault().syncExec(restoreDialog);
- return restoreDialog.fRestore;
- }
-
- private class ConfirmRestoreDialog implements Runnable {
+ return restoreDialog.fRestore;
+ }
+
+ private class ConfirmRestoreDialog implements Runnable {
+
+ private Boolean fRestore = false;
- private Boolean fRestore = false;
-
@Override
public void run() {
Shell parent = DsfUIPlugin.getActiveWorkbenchShell();
if (parent != null) {
-
- String title = Messages.RegisterGroupConfirmRestoreTitle;
- String message = Messages.RegisterGroupConfirmRestoreMessage;
- String[] buttonLabels = new String[]{Messages.RegisterGroupRestore, Messages.RegisterGroupRestoreCancel,
- };
- MessageDialog dialog = new MessageDialog(parent, title, null, message, MessageDialog.QUESTION,
- buttonLabels, 0);
- int res = dialog.open();
- if (res == 0) { // RESTORE
- fRestore = true;
- } else if (res == 1) { // CANCEL
- fRestore = false;
- }
- }
+
+ String title = Messages.RegisterGroupConfirmRestoreTitle;
+ String message = Messages.RegisterGroupConfirmRestoreMessage;
+ String[] buttonLabels = new String[] { Messages.RegisterGroupRestore,
+ Messages.RegisterGroupRestoreCancel, };
+ MessageDialog dialog = new MessageDialog(parent, title, null, message, MessageDialog.QUESTION,
+ buttonLabels, 0);
+ int res = dialog.open();
+ if (res == 0) { // RESTORE
+ fRestore = true;
+ } else if (res == 1) { // CANCEL
+ fRestore = false;
+ }
+ }
}
-
- }
-
-
- private void getRegistersData(IRegisterDMContext[] regDMCs, IRegisters2 regService, final DataRequestMonitor<IRegisterDMData[]> rm) {
+
+ }
+
+ private void getRegistersData(IRegisterDMContext[] regDMCs, IRegisters2 regService,
+ final DataRequestMonitor<IRegisterDMData[]> rm) {
final IRegisterDMData[] regDataArray = new IRegisterDMData[regDMCs.length];
final DsfExecutor executor = regService.getExecutor();
-
+
final CountingRequestMonitor crm = new CountingRequestMonitor(executor, rm) {
@Override
protected void handleSuccess() {
@@ -996,7 +1025,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
rm.done();
}
};
-
+
for (int i = 0; i < regDMCs.length; i++) {
final int index = i;
regService.getRegisterData(regDMCs[index], new DataRequestMonitor<IRegisterDMData>(executor, crm) {
@@ -1007,7 +1036,7 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
}
});
}
-
+
crm.setDoneCount(regDMCs.length);
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyMoveToLineAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyMoveToLineAdapter.java
index 4ee134cb34a..813ec81f035 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyMoveToLineAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyMoveToLineAdapter.java
@@ -35,7 +35,7 @@ import org.eclipse.ui.IWorkbenchPart;
/**
* Move to line target adapter for the DSF Disassembly view
- *
+ *
* @since 2.1
*/
public class DisassemblyMoveToLineAdapter implements IMoveToLineTarget {
@@ -44,37 +44,36 @@ public class DisassemblyMoveToLineAdapter implements IMoveToLineTarget {
public void moveToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException {
if (part instanceof IDisassemblyPart && selection instanceof ITextSelection) {
if (!(selection instanceof IDisassemblySelection)) {
- selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
+ selection = new DisassemblySelection((ITextSelection) selection, (IDisassemblyPart) part);
}
- IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
+ IDisassemblySelection disassemblySelection = (IDisassemblySelection) selection;
final IAddress address = disassemblySelection.getStartAddress();
-
- if (address != null && target instanceof IAdaptable) {
- final IMoveToAddress moveToAddress = ((IAdaptable)target).getAdapter(IMoveToAddress.class);
- if (moveToAddress != null && moveToAddress.canMoveToAddress(address)) {
- try {
- moveToAddress.moveToAddress(address);
- }
- catch(DebugException e) {
- failed(e);
- }
- }
- }
+
+ if (address != null && target instanceof IAdaptable) {
+ final IMoveToAddress moveToAddress = ((IAdaptable) target).getAdapter(IMoveToAddress.class);
+ if (moveToAddress != null && moveToAddress.canMoveToAddress(address)) {
+ try {
+ moveToAddress.moveToAddress(address);
+ } catch (DebugException e) {
+ failed(e);
+ }
+ }
+ }
}
}
@Override
public boolean canMoveToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) {
if (target instanceof IAdaptable && part instanceof IDisassemblyPart && selection instanceof ITextSelection) {
- IMoveToAddress moveToAddress = ((IAdaptable)target).getAdapter(IMoveToAddress.class);
+ IMoveToAddress moveToAddress = ((IAdaptable) target).getAdapter(IMoveToAddress.class);
if (moveToAddress == null) {
return false;
}
-
+
if (!(selection instanceof IDisassemblySelection)) {
- selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
+ selection = new DisassemblySelection((ITextSelection) selection, (IDisassemblyPart) part);
}
- IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
+ IDisassemblySelection disassemblySelection = (IDisassemblySelection) selection;
final IAddress address = disassemblySelection.getStartAddress();
if (address == null) {
return false;
@@ -86,9 +85,11 @@ public class DisassemblyMoveToLineAdapter implements IMoveToLineTarget {
return false;
}
- protected void failed( Throwable e ) {
- MultiStatus ms = new MultiStatus(CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED, "MoveToLine failed", null); //$NON-NLS-1$
- ms.add( new Status(IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED, e.getMessage(), e));
+ protected void failed(Throwable e) {
+ MultiStatus ms = new MultiStatus(CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED,
+ "MoveToLine failed", null); //$NON-NLS-1$
+ ms.add(new Status(IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED,
+ e.getMessage(), e));
DsfUIPlugin.log(ms);
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyResumeAtLineAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyResumeAtLineAdapter.java
index cc6a828a37f..dd03333db71 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyResumeAtLineAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyResumeAtLineAdapter.java
@@ -35,46 +35,45 @@ import org.eclipse.ui.IWorkbenchPart;
/**
* Resume at line target adapter for the DSF Disassembly view
- *
+ *
* @since 2.1
*/
public class DisassemblyResumeAtLineAdapter implements IResumeAtLineTarget {
@Override
- public void resumeAtLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException {
+ public void resumeAtLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException {
if (part instanceof IDisassemblyPart && selection instanceof ITextSelection) {
if (!(selection instanceof IDisassemblySelection)) {
- selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
+ selection = new DisassemblySelection((ITextSelection) selection, (IDisassemblyPart) part);
}
- IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
+ IDisassemblySelection disassemblySelection = (IDisassemblySelection) selection;
final IAddress address = disassemblySelection.getStartAddress();
- if (address != null && target instanceof IAdaptable) {
- final IResumeAtAddress resumeAtAddress = ((IAdaptable)target).getAdapter(IResumeAtAddress.class);
- if (resumeAtAddress != null && resumeAtAddress.canResumeAtAddress(address)) {
- try {
- resumeAtAddress.resumeAtAddress(address);
- }
- catch(DebugException e) {
- failed(e);
- }
- }
- }
+ if (address != null && target instanceof IAdaptable) {
+ final IResumeAtAddress resumeAtAddress = ((IAdaptable) target).getAdapter(IResumeAtAddress.class);
+ if (resumeAtAddress != null && resumeAtAddress.canResumeAtAddress(address)) {
+ try {
+ resumeAtAddress.resumeAtAddress(address);
+ } catch (DebugException e) {
+ failed(e);
+ }
+ }
+ }
}
}
@Override
public boolean canResumeAtLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) {
if (target instanceof IAdaptable && part instanceof IDisassemblyPart && selection instanceof ITextSelection) {
- IResumeAtAddress resumeAtAddress = ((IAdaptable)target).getAdapter(IResumeAtAddress.class);
+ IResumeAtAddress resumeAtAddress = ((IAdaptable) target).getAdapter(IResumeAtAddress.class);
if (resumeAtAddress == null) {
return false;
}
-
+
if (!(selection instanceof IDisassemblySelection)) {
- selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
+ selection = new DisassemblySelection((ITextSelection) selection, (IDisassemblyPart) part);
}
- IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
+ IDisassemblySelection disassemblySelection = (IDisassemblySelection) selection;
final IAddress address = disassemblySelection.getStartAddress();
if (address == null) {
return false;
@@ -86,9 +85,11 @@ public class DisassemblyResumeAtLineAdapter implements IResumeAtLineTarget {
return false;
}
- protected void failed( Throwable e ) {
- MultiStatus ms = new MultiStatus(CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED, "Resume At Line failed", null); //$NON-NLS-1$
- ms.add( new Status(IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED, e.getMessage(), e));
+ protected void failed(Throwable e) {
+ MultiStatus ms = new MultiStatus(CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED,
+ "Resume At Line failed", null); //$NON-NLS-1$
+ ms.add(new Status(IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED,
+ e.getMessage(), e));
DsfUIPlugin.log(ms);
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyRunToLineAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyRunToLineAdapter.java
index 73100505ae3..86f6cfe1964 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyRunToLineAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DisassemblyRunToLineAdapter.java
@@ -37,7 +37,7 @@ import org.eclipse.ui.IWorkbenchPart;
/**
* Run to line target adapter for the DSF Disassembly view
- *
+ *
* @since 2.1
*/
public class DisassemblyRunToLineAdapter implements IRunToLineTarget {
@@ -49,21 +49,21 @@ public class DisassemblyRunToLineAdapter implements IRunToLineTarget {
public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException {
if (part instanceof IDisassemblyPart && selection instanceof ITextSelection) {
if (!(selection instanceof IDisassemblySelection)) {
- selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
+ selection = new DisassemblySelection((ITextSelection) selection, (IDisassemblyPart) part);
}
- IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
+ IDisassemblySelection disassemblySelection = (IDisassemblySelection) selection;
final IAddress address = disassemblySelection.getStartAddress();
if (address != null && target instanceof IAdaptable) {
- final IRunToAddress runToAddress = ((IAdaptable)target).getAdapter(IRunToAddress.class);
+ final IRunToAddress runToAddress = ((IAdaptable) target).getAdapter(IRunToAddress.class);
if (runToAddress != null && runToAddress.canRunToAddress(address)) {
try {
- boolean skipBreakpoints = DebugUITools.getPreferenceStore().getBoolean(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE);
- runToAddress.runToAddress(address, skipBreakpoints);
- }
- catch(DebugException e) {
+ boolean skipBreakpoints = DebugUITools.getPreferenceStore()
+ .getBoolean(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE);
+ runToAddress.runToAddress(address, skipBreakpoints);
+ } catch (DebugException e) {
failed(e);
- }
+ }
}
}
}
@@ -75,15 +75,15 @@ public class DisassemblyRunToLineAdapter implements IRunToLineTarget {
@Override
public boolean canRunToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) {
if (target instanceof IAdaptable && part instanceof IDisassemblyPart && selection instanceof ITextSelection) {
- IRunToAddress runToAddress = ((IAdaptable)target).getAdapter(IRunToAddress.class);
+ IRunToAddress runToAddress = ((IAdaptable) target).getAdapter(IRunToAddress.class);
if (runToAddress == null) {
return false;
}
-
+
if (!(selection instanceof IDisassemblySelection)) {
- selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
+ selection = new DisassemblySelection((ITextSelection) selection, (IDisassemblyPart) part);
}
- IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
+ IDisassemblySelection disassemblySelection = (IDisassemblySelection) selection;
final IAddress address = disassemblySelection.getStartAddress();
if (address == null) {
return false;
@@ -95,9 +95,11 @@ public class DisassemblyRunToLineAdapter implements IRunToLineTarget {
return false;
}
- protected void failed( Throwable e ) {
- MultiStatus ms = new MultiStatus( CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED, "RunToLine failed", null ); //$NON-NLS-1$
- ms.add( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED, e.getMessage(), e ) );
+ protected void failed(Throwable e) {
+ MultiStatus ms = new MultiStatus(CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED,
+ "RunToLine failed", null); //$NON-NLS-1$
+ ms.add(new Status(IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), IDsfStatusConstants.REQUEST_FAILED,
+ e.getMessage(), e));
DsfUIPlugin.log(ms);
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfAddRegisterGroupCommand.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfAddRegisterGroupCommand.java
index bf382377a4a..c53761dcf17 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfAddRegisterGroupCommand.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfAddRegisterGroupCommand.java
@@ -29,23 +29,23 @@ public class DsfAddRegisterGroupCommand extends AbstractDsfRegisterGroupActions
@Override
public void setEnabled(Object evaluationContext) {
boolean state = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
- Object p = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME);
- if (s instanceof IStructuredSelection && p instanceof IWorkbenchPart) {
- state = canAddRegisterGroup((IWorkbenchPart)p, (IStructuredSelection)s);
- }
- }
+ if (evaluationContext instanceof IEvaluationContext) {
+ Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
+ Object p = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME);
+ if (s instanceof IStructuredSelection && p instanceof IWorkbenchPart) {
+ state = canAddRegisterGroup((IWorkbenchPart) p, (IStructuredSelection) s);
+ }
+ }
setBaseEnabled(state);
}
-
+
@Override
public Object execute(ExecutionEvent event) {
ISelection selection = HandlerUtil.getCurrentSelection(event);
IWorkbenchPart part = HandlerUtil.getActivePart(event);
if (selection instanceof IStructuredSelection) {
- addRegisterGroup(part, (IStructuredSelection)selection);
+ addRegisterGroup(part, (IStructuredSelection) selection);
}
- return null;
- }
+ return null;
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfEditRegisterGroupCommand.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfEditRegisterGroupCommand.java
index c9cb7b10c13..656b80c268d 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfEditRegisterGroupCommand.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfEditRegisterGroupCommand.java
@@ -29,23 +29,23 @@ public class DsfEditRegisterGroupCommand extends AbstractDsfRegisterGroupActions
@Override
public void setEnabled(Object evaluationContext) {
boolean state = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
- Object p = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME);
- if (s instanceof IStructuredSelection && p instanceof IWorkbenchPart) {
- state = canEditRegisterGroup((IWorkbenchPart)p, (IStructuredSelection)s);
- }
- }
+ if (evaluationContext instanceof IEvaluationContext) {
+ Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
+ Object p = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME);
+ if (s instanceof IStructuredSelection && p instanceof IWorkbenchPart) {
+ state = canEditRegisterGroup((IWorkbenchPart) p, (IStructuredSelection) s);
+ }
+ }
setBaseEnabled(state);
}
-
+
@Override
public Object execute(ExecutionEvent event) {
ISelection selection = HandlerUtil.getCurrentSelection(event);
IWorkbenchPart part = HandlerUtil.getActivePart(event);
if (selection instanceof IStructuredSelection) {
- editRegisterGroup(part, (IStructuredSelection)selection);
+ editRegisterGroup(part, (IStructuredSelection) selection);
}
- return null;
- }
+ return null;
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRemoveRegisterGroupsCommand.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRemoveRegisterGroupsCommand.java
index f1766f7416f..bac37622572 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRemoveRegisterGroupsCommand.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRemoveRegisterGroupsCommand.java
@@ -29,23 +29,23 @@ public class DsfRemoveRegisterGroupsCommand extends AbstractDsfRegisterGroupActi
@Override
public void setEnabled(Object evaluationContext) {
boolean state = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
- Object p = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME);
- if (s instanceof IStructuredSelection && p instanceof IWorkbenchPart) {
- state = canRemoveRegisterGroups((IWorkbenchPart)p, (IStructuredSelection)s);
- }
- }
+ if (evaluationContext instanceof IEvaluationContext) {
+ Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
+ Object p = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME);
+ if (s instanceof IStructuredSelection && p instanceof IWorkbenchPart) {
+ state = canRemoveRegisterGroups((IWorkbenchPart) p, (IStructuredSelection) s);
+ }
+ }
setBaseEnabled(state);
}
-
+
@Override
public Object execute(ExecutionEvent event) {
ISelection selection = HandlerUtil.getCurrentSelection(event);
IWorkbenchPart part = HandlerUtil.getActivePart(event);
if (selection instanceof IStructuredSelection) {
- removeRegisterGroups(part, (IStructuredSelection)selection);
+ removeRegisterGroups(part, (IStructuredSelection) selection);
}
- return null;
- }
+ return null;
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRestoreRegisterGroupsCommand.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRestoreRegisterGroupsCommand.java
index 145cf4788f1..d075f8092ed 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRestoreRegisterGroupsCommand.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/DsfRestoreRegisterGroupsCommand.java
@@ -29,23 +29,23 @@ public class DsfRestoreRegisterGroupsCommand extends AbstractDsfRegisterGroupAct
@Override
public void setEnabled(Object evaluationContext) {
boolean state = false;
- if (evaluationContext instanceof IEvaluationContext) {
- Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
- Object p = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME);
- if (s instanceof IStructuredSelection && p instanceof IWorkbenchPart) {
- state = canRestoreDefaultGroups((IWorkbenchPart)p, (IStructuredSelection)s);
- }
- }
+ if (evaluationContext instanceof IEvaluationContext) {
+ Object s = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_MENU_SELECTION_NAME);
+ Object p = ((IEvaluationContext) evaluationContext).getVariable(ISources.ACTIVE_PART_NAME);
+ if (s instanceof IStructuredSelection && p instanceof IWorkbenchPart) {
+ state = canRestoreDefaultGroups((IWorkbenchPart) p, (IStructuredSelection) s);
+ }
+ }
setBaseEnabled(state);
}
-
+
@Override
public Object execute(ExecutionEvent event) {
ISelection selection = HandlerUtil.getCurrentSelection(event);
IWorkbenchPart part = HandlerUtil.getActivePart(event);
if (selection instanceof IStructuredSelection) {
- restoreDefaultGroups(part, (IStructuredSelection)selection);
+ restoreDefaultGroups(part, (IStructuredSelection) selection);
}
- return null;
- }
+ return null;
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/IDsfActionsConstants.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/IDsfActionsConstants.java
index d5c519fe163..ad3dd7c4b7c 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/IDsfActionsConstants.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/IDsfActionsConstants.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IAR Systems - initial API and implementation
*******************************************************************************/
@@ -15,16 +15,15 @@ package org.eclipse.cdt.dsf.debug.internal.ui.actions;
/**
* Constants used by the DSF UI action adapters
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
*/
interface IDsfActionsConstants {
/**
- * The timeout in ms which action adapters will wait before disabling
+ * The timeout in ms which action adapters will wait before disabling
* the action itself, in order to avoid blocking the UI thread while
* waiting for the DSF thread to service a blocking query.
*/
static final int ACTION_ADAPTERS_TIMEOUT_MS = 500;
}
-
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/MoveToLine.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/MoveToLine.java
index c71a1262cf6..351438eb986 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/MoveToLine.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/MoveToLine.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Ericsson - initial API and implementation
*******************************************************************************/
@@ -35,158 +35,162 @@ import org.eclipse.debug.core.DebugException;
/**
* Implements the CDT's move to line interface.
- *
+ *
* @since 2.1
*/
public class MoveToLine implements IMoveToLine, IMoveToAddress {
- private final IExecutionDMContext fContext;
+ private final IExecutionDMContext fContext;
- public MoveToLine(IExecutionDMContext context) {
- fContext = context;
- }
+ public MoveToLine(IExecutionDMContext context) {
+ fContext = context;
+ }
- @Override
+ @Override
public boolean canMoveToLine(final String fileName, final int lineNumber) {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- try {
- Query<Boolean> query = new Query<Boolean>() {
- @Override
- protected void execute(DataRequestMonitor<Boolean> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.canMoveToLine(fContext, fileName, lineNumber, false, rm);
- } else {
- rm.setData(false);
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException e) {
- } catch (InterruptedException e) {
- } catch (ExecutionException e) {
- } catch (TimeoutException e) {
- }
- }
- return false;
- }
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ try {
+ Query<Boolean> query = new Query<Boolean>() {
+ @Override
+ protected void execute(DataRequestMonitor<Boolean> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
- @Override
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.canMoveToLine(fContext, fileName, lineNumber, false, rm);
+ } else {
+ rm.setData(false);
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) {
+ } catch (InterruptedException e) {
+ } catch (ExecutionException e) {
+ } catch (TimeoutException e) {
+ }
+ }
+ return false;
+ }
+
+ @Override
public void moveToLine(final String fileName, final int lineNumber) throws DebugException {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- Throwable exception = null;
- try {
- Query<Object> query = new Query<Object>() {
- @Override
- protected void execute(final DataRequestMonitor<Object> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.moveToLine(
- fContext, fileName, lineNumber, false, rm);
- } else {
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- query.get();
- } catch (RejectedExecutionException e) {
- exception = e;
- } catch (InterruptedException e) {
- exception = e;
- } catch (ExecutionException e) {
- exception = e;
- }
- if (exception != null) {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Failed executing move to line", exception)); //$NON-NLS-1$
- }
- } else {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Debug session is not active", null)); //$NON-NLS-1$
- }
- }
-
- @Override
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ Throwable exception = null;
+ try {
+ Query<Object> query = new Query<Object>() {
+ @Override
+ protected void execute(final DataRequestMonitor<Object> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.moveToLine(fContext, fileName, lineNumber, false, rm);
+ } else {
+ rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID,
+ IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ query.get();
+ } catch (RejectedExecutionException e) {
+ exception = e;
+ } catch (InterruptedException e) {
+ exception = e;
+ } catch (ExecutionException e) {
+ exception = e;
+ }
+ if (exception != null) {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Failed executing move to line", exception)); //$NON-NLS-1$
+ }
+ } else {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Debug session is not active", null)); //$NON-NLS-1$
+ }
+ }
+
+ @Override
public boolean canMoveToAddress(final IAddress address) {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- try {
- Query<Boolean> query = new Query<Boolean>() {
- @Override
- protected void execute(DataRequestMonitor<Boolean> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.canMoveToAddress(fContext, address, false, rm);
- } else {
- rm.setData(false);
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException e) {
- } catch (InterruptedException e) {
- } catch (ExecutionException e) {
- } catch (TimeoutException e) {
- }
- }
- return false;
- }
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ try {
+ Query<Boolean> query = new Query<Boolean>() {
+ @Override
+ protected void execute(DataRequestMonitor<Boolean> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.canMoveToAddress(fContext, address, false, rm);
+ } else {
+ rm.setData(false);
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) {
+ } catch (InterruptedException e) {
+ } catch (ExecutionException e) {
+ } catch (TimeoutException e) {
+ }
+ }
+ return false;
+ }
- @Override
+ @Override
public void moveToAddress(final IAddress address) throws DebugException {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- Throwable exception = null;
- try {
- Query<Object> query = new Query<Object>() {
- @Override
- protected void execute(final DataRequestMonitor<Object> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.moveToAddress(
- fContext, address, false, rm);
- } else {
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- query.get();
- } catch (RejectedExecutionException e) {
- exception = e;
- } catch (InterruptedException e) {
- exception = e;
- } catch (ExecutionException e) {
- exception = e;
- }
- if (exception != null) {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Failed executing move to line", exception)); //$NON-NLS-1$
- }
- } else {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Debug session is not active", null)); //$NON-NLS-1$
- }
- }
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ Throwable exception = null;
+ try {
+ Query<Object> query = new Query<Object>() {
+ @Override
+ protected void execute(final DataRequestMonitor<Object> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.moveToAddress(fContext, address, false, rm);
+ } else {
+ rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID,
+ IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ query.get();
+ } catch (RejectedExecutionException e) {
+ exception = e;
+ } catch (InterruptedException e) {
+ exception = e;
+ } catch (ExecutionException e) {
+ exception = e;
+ }
+ if (exception != null) {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Failed executing move to line", exception)); //$NON-NLS-1$
+ }
+ } else {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Debug session is not active", null)); //$NON-NLS-1$
+ }
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/ResumeAtLine.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/ResumeAtLine.java
index f82399a734f..d08c8d3f5e5 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/ResumeAtLine.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/ResumeAtLine.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Ericsson - initial API and implementation
*******************************************************************************/
@@ -36,16 +36,16 @@ import org.eclipse.debug.core.DebugException;
/**
* Implements the CDT's resume at line interface.
- *
+ *
* @since 2.1
*/
public class ResumeAtLine implements IResumeAtLine, IResumeAtAddress {
- private final IExecutionDMContext fContext;
+ private final IExecutionDMContext fContext;
- public ResumeAtLine(IExecutionDMContext context) {
- fContext = context;
- }
+ public ResumeAtLine(IExecutionDMContext context) {
+ fContext = context;
+ }
@Override
public boolean canResumeAtLine(IFile file, final int lineNumber) {
@@ -54,151 +54,155 @@ public class ResumeAtLine implements IResumeAtLine, IResumeAtAddress {
@Override
public boolean canResumeAtLine(final String fileName, final int lineNumber) {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- try {
- Query<Boolean> query = new Query<Boolean>() {
- @Override
- protected void execute(DataRequestMonitor<Boolean> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.canMoveToLine(fContext, fileName, lineNumber, true, rm);
- } else {
- rm.setData(false);
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException e) {
- } catch (InterruptedException e) {
- } catch (ExecutionException e) {
- } catch (TimeoutException e) {
- }
- }
- return false;
- }
-
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ try {
+ Query<Boolean> query = new Query<Boolean>() {
+ @Override
+ protected void execute(DataRequestMonitor<Boolean> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.canMoveToLine(fContext, fileName, lineNumber, true, rm);
+ } else {
+ rm.setData(false);
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) {
+ } catch (InterruptedException e) {
+ } catch (ExecutionException e) {
+ } catch (TimeoutException e) {
+ }
+ }
+ return false;
+ }
+
@Override
public void resumeAtLine(IFile file, int lineNumber) throws DebugException {
resumeAtLine(file.getLocation().makeAbsolute().toOSString(), lineNumber);
}
-
+
@Override
public void resumeAtLine(final String fileName, final int lineNumber) throws DebugException {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- Throwable exception = null;
- try {
- Query<Object> query = new Query<Object>() {
- @Override
- protected void execute(final DataRequestMonitor<Object> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.moveToLine(
- fContext, fileName, lineNumber, true, rm);
- } else {
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- query.get();
- } catch (RejectedExecutionException e) {
- exception = e;
- } catch (InterruptedException e) {
- exception = e;
- } catch (ExecutionException e) {
- exception = e;
- }
- if (exception != null) {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Failed executing move to line", exception)); //$NON-NLS-1$
- }
- } else {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Debug session is not active", null)); //$NON-NLS-1$
- }
- }
-
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ Throwable exception = null;
+ try {
+ Query<Object> query = new Query<Object>() {
+ @Override
+ protected void execute(final DataRequestMonitor<Object> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.moveToLine(fContext, fileName, lineNumber, true, rm);
+ } else {
+ rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID,
+ IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ query.get();
+ } catch (RejectedExecutionException e) {
+ exception = e;
+ } catch (InterruptedException e) {
+ exception = e;
+ } catch (ExecutionException e) {
+ exception = e;
+ }
+ if (exception != null) {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Failed executing move to line", exception)); //$NON-NLS-1$
+ }
+ } else {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Debug session is not active", null)); //$NON-NLS-1$
+ }
+ }
+
@Override
public boolean canResumeAtAddress(final IAddress address) {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- try {
- Query<Boolean> query = new Query<Boolean>() {
- @Override
- protected void execute(DataRequestMonitor<Boolean> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.canMoveToAddress(fContext, address, true, rm);
- } else {
- rm.setData(false);
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException e) {
- } catch (InterruptedException e) {
- } catch (ExecutionException e) {
- } catch (TimeoutException e) {
- }
- }
- return false;
- }
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ try {
+ Query<Boolean> query = new Query<Boolean>() {
+ @Override
+ protected void execute(DataRequestMonitor<Boolean> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.canMoveToAddress(fContext, address, true, rm);
+ } else {
+ rm.setData(false);
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) {
+ } catch (InterruptedException e) {
+ } catch (ExecutionException e) {
+ } catch (TimeoutException e) {
+ }
+ }
+ return false;
+ }
@Override
public void resumeAtAddress(final IAddress address) throws DebugException {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- Throwable exception = null;
- try {
- Query<Object> query = new Query<Object>() {
- @Override
- protected void execute(final DataRequestMonitor<Object> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.moveToAddress(
- fContext, address, true, rm);
- } else {
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- query.get();
- } catch (RejectedExecutionException e) {
- exception = e;
- } catch (InterruptedException e) {
- exception = e;
- } catch (ExecutionException e) {
- exception = e;
- }
- if (exception != null) {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Failed executing move to line", exception)); //$NON-NLS-1$
- }
- } else {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Debug session is not active", null)); //$NON-NLS-1$
- }
- }
-
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ Throwable exception = null;
+ try {
+ Query<Object> query = new Query<Object>() {
+ @Override
+ protected void execute(final DataRequestMonitor<Object> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.moveToAddress(fContext, address, true, rm);
+ } else {
+ rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID,
+ IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ query.get();
+ } catch (RejectedExecutionException e) {
+ exception = e;
+ } catch (InterruptedException e) {
+ exception = e;
+ } catch (ExecutionException e) {
+ exception = e;
+ }
+ if (exception != null) {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Failed executing move to line", exception)); //$NON-NLS-1$
+ }
+ } else {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Debug session is not active", null)); //$NON-NLS-1$
+ }
+ }
+
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RetargettableActionAdapterFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RetargettableActionAdapterFactory.java
index 1f18ec28f7e..431c06ba4b7 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RetargettableActionAdapterFactory.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RetargettableActionAdapterFactory.java
@@ -20,7 +20,7 @@ import org.eclipse.debug.ui.actions.IRunToLineTarget;
/**
* Retargettable Action Adapter Factory for the DSF Disassembly view
- *
+ *
* @since 2.1
*/
public class RetargettableActionAdapterFactory implements IAdapterFactory {
@@ -32,13 +32,13 @@ public class RetargettableActionAdapterFactory implements IAdapterFactory {
@SuppressWarnings("unchecked")
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (adapterType == IRunToLineTarget.class) {
- return (T)new DisassemblyRunToLineAdapter();
- }
+ return (T) new DisassemblyRunToLineAdapter();
+ }
if (adapterType == IMoveToLineTarget.class) {
- return (T)new DisassemblyMoveToLineAdapter();
- }
+ return (T) new DisassemblyMoveToLineAdapter();
+ }
if (adapterType == IResumeAtLineTarget.class) {
- return (T)new DisassemblyResumeAtLineAdapter();
+ return (T) new DisassemblyResumeAtLineAdapter();
}
return null;
}
@@ -48,6 +48,6 @@ public class RetargettableActionAdapterFactory implements IAdapterFactory {
*/
@Override
public Class<?>[] getAdapterList() {
- return new Class[]{ IRunToLineTarget.class, IResumeAtLineTarget.class, IMoveToLineTarget.class };
+ return new Class[] { IRunToLineTarget.class, IResumeAtLineTarget.class, IMoveToLineTarget.class };
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RunToLine.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RunToLine.java
index 38ffb06b6a4..956f40ee29a 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RunToLine.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/RunToLine.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* Ericsson - Added support for IRunToAddress for DSF DisassemblyView (302324)
@@ -39,167 +39,173 @@ import org.eclipse.debug.ui.actions.IRunToLineTarget;
/**
* Implements the CDT's run to line interface. This interface is called by CDT's
* {@link IRunToLineTarget} implementation.
- *
+ *
* @since 2.1
*/
public class RunToLine implements IRunToLine, IRunToAddress {
- private final IExecutionDMContext fContext;
+ private final IExecutionDMContext fContext;
- public RunToLine(IExecutionDMContext context) {
- fContext = context;
- }
-
- @Override
+ public RunToLine(IExecutionDMContext context) {
+ fContext = context;
+ }
+
+ @Override
public boolean canRunToLine(final IFile file, final int lineNumber) {
- return canRunToLine(file.getLocation().makeAbsolute().toOSString(), lineNumber);
- }
+ return canRunToLine(file.getLocation().makeAbsolute().toOSString(), lineNumber);
+ }
- @Override
+ @Override
public boolean canRunToLine(final String fileName, final int lineNumber) {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- try {
- Query<Boolean> query = new Query<Boolean>() {
- @Override
- protected void execute(DataRequestMonitor<Boolean> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.canRunToLine(fContext, fileName, lineNumber, rm);
- } else {
- rm.setData(false);
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException e) {
- } catch (InterruptedException e) {
- } catch (ExecutionException e) {
- } catch (TimeoutException e) {
- }
- }
- return false;
- }
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ try {
+ Query<Boolean> query = new Query<Boolean>() {
+ @Override
+ protected void execute(DataRequestMonitor<Boolean> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.canRunToLine(fContext, fileName, lineNumber, rm);
+ } else {
+ rm.setData(false);
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) {
+ } catch (InterruptedException e) {
+ } catch (ExecutionException e) {
+ } catch (TimeoutException e) {
+ }
+ }
+ return false;
+ }
- @Override
+ @Override
public void runToLine(IFile file, int lineNumber, boolean skipBreakpoints) throws DebugException {
- runToLine(file.getLocation().makeAbsolute().toOSString(), lineNumber, skipBreakpoints);
- }
-
- @Override
- public void runToLine(final String fileName, final int lineNumber, final boolean skipBreakpoints) throws DebugException {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- Throwable exception = null;
- try {
- Query<Object> query = new Query<Object>() {
- @Override
- protected void execute(final DataRequestMonitor<Object> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.runToLine(
- fContext, fileName, lineNumber, skipBreakpoints, rm);
- } else {
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- query.get();
- } catch (RejectedExecutionException e) {
- exception = e;
- } catch (InterruptedException e) {
- exception = e;
- } catch (ExecutionException e) {
- exception = e;
- }
- if (exception != null) {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Failed executing run to line", exception)); //$NON-NLS-1$
- }
- } else {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Debug session is not active", null)); //$NON-NLS-1$
- }
- }
-
+ runToLine(file.getLocation().makeAbsolute().toOSString(), lineNumber, skipBreakpoints);
+ }
+
+ @Override
+ public void runToLine(final String fileName, final int lineNumber, final boolean skipBreakpoints)
+ throws DebugException {
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ Throwable exception = null;
+ try {
+ Query<Object> query = new Query<Object>() {
+ @Override
+ protected void execute(final DataRequestMonitor<Object> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.runToLine(fContext, fileName, lineNumber, skipBreakpoints, rm);
+ } else {
+ rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID,
+ IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ query.get();
+ } catch (RejectedExecutionException e) {
+ exception = e;
+ } catch (InterruptedException e) {
+ exception = e;
+ } catch (ExecutionException e) {
+ exception = e;
+ }
+ if (exception != null) {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Failed executing run to line", exception)); //$NON-NLS-1$
+ }
+ } else {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Debug session is not active", null)); //$NON-NLS-1$
+ }
+ }
+
@Override
public boolean canRunToAddress(final IAddress address) {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- try {
- Query<Boolean> query = new Query<Boolean>() {
- @Override
- protected void execute(DataRequestMonitor<Boolean> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.canRunToAddress(fContext, address, rm);
- } else {
- rm.setData(false);
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException e) {
- } catch (InterruptedException e) {
- } catch (ExecutionException e) {
- } catch (TimeoutException e) {
- }
- }
- return false;
- }
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ try {
+ Query<Boolean> query = new Query<Boolean>() {
+ @Override
+ protected void execute(DataRequestMonitor<Boolean> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.canRunToAddress(fContext, address, rm);
+ } else {
+ rm.setData(false);
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ return query.get(IDsfActionsConstants.ACTION_ADAPTERS_TIMEOUT_MS, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) {
+ } catch (InterruptedException e) {
+ } catch (ExecutionException e) {
+ } catch (TimeoutException e) {
+ }
+ }
+ return false;
+ }
@Override
public void runToAddress(final IAddress address, final boolean skipBreakpoints) throws DebugException {
- DsfSession session = DsfSession.getSession(fContext.getSessionId());
- if (session != null && session.isActive()) {
- Throwable exception = null;
- try {
- Query<Object> query = new Query<Object>() {
- @Override
- protected void execute(final DataRequestMonitor<Object> rm) {
- DsfServicesTracker tracker =
- new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fContext.getSessionId());
-
- IRunControl2 runControl = tracker.getService(IRunControl2.class);
- if (runControl != null) {
- runControl.runToAddress(fContext, address, skipBreakpoints, rm);
- } else {
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
- rm.done();
- }
- tracker.dispose();
- }
- };
- session.getExecutor().execute(query);
- query.get();
- } catch (RejectedExecutionException e) {
- exception = e;
- } catch (InterruptedException e) {
- exception = e;
- } catch (ExecutionException e) {
- exception = e;
- }
- if (exception != null) {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Failed executing run to line", exception)); //$NON-NLS-1$
- }
- } else {
- throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Debug session is not active", null)); //$NON-NLS-1$
- }
- }
- }
+ DsfSession session = DsfSession.getSession(fContext.getSessionId());
+ if (session != null && session.isActive()) {
+ Throwable exception = null;
+ try {
+ Query<Object> query = new Query<Object>() {
+ @Override
+ protected void execute(final DataRequestMonitor<Object> rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(),
+ fContext.getSessionId());
+
+ IRunControl2 runControl = tracker.getService(IRunControl2.class);
+ if (runControl != null) {
+ runControl.runToAddress(fContext, address, skipBreakpoints, rm);
+ } else {
+ rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID,
+ IDsfStatusConstants.NOT_SUPPORTED, "IRunControl2 service not available", null)); //$NON-NLS-1$
+ rm.done();
+ }
+ tracker.dispose();
+ }
+ };
+ session.getExecutor().execute(query);
+ query.get();
+ } catch (RejectedExecutionException e) {
+ exception = e;
+ } catch (InterruptedException e) {
+ exception = e;
+ } catch (ExecutionException e) {
+ exception = e;
+ }
+ if (exception != null) {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Failed executing run to line", exception)); //$NON-NLS-1$
+ }
+ } else {
+ throw new DebugException(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED,
+ "Debug session is not active", null)); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/DebugViewLayoutTester.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/DebugViewLayoutTester.java
index 04f44bf89d5..b33f5d334df 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/DebugViewLayoutTester.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/DebugViewLayoutTester.java
@@ -18,32 +18,32 @@ import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
import org.eclipse.core.expressions.PropertyTester;
/**
- * Property tester for debug view related commands - group, ungroup, hide, etc.
- *
+ * Property tester for debug view related commands - group, ungroup, hide, etc.
+ *
* @since 2.2
*/
-public class DebugViewLayoutTester extends PropertyTester{
-
+public class DebugViewLayoutTester extends PropertyTester {
+
public DebugViewLayoutTester() {
}
protected static final String IS_GROUP_VISIBLE = "isGroupDebugContextsVisible"; //$NON-NLS-1$
protected static final String IS_UNGROUP_VISIBLE = "isUngroupDebugContextsVisible"; //$NON-NLS-1$
-
+
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if( IS_GROUP_VISIBLE.equals(property) || IS_UNGROUP_VISIBLE.equals(property)) {
- if (receiver instanceof IDMVMContext) {
- return test((IDMVMContext)receiver);
- }
- }
- return false;
- }
-
- private boolean test(IDMVMContext dmContext) {
+ if (IS_GROUP_VISIBLE.equals(property) || IS_UNGROUP_VISIBLE.equals(property)) {
+ if (receiver instanceof IDMVMContext) {
+ return test((IDMVMContext) receiver);
+ }
+ }
+ return false;
+ }
+
+ private boolean test(IDMVMContext dmContext) {
String sessionId = dmContext.getDMContext().getSessionId();
return DsfSession.isSessionActive(sessionId);
- }
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfDebugViewLayoutCommand.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfDebugViewLayoutCommand.java
index 3ee859c9acb..b8e84e5438c 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfDebugViewLayoutCommand.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfDebugViewLayoutCommand.java
@@ -35,86 +35,84 @@ import org.eclipse.debug.core.commands.IEnabledStateRequest;
/**
* @since 2.2
*/
-public abstract class DsfDebugViewLayoutCommand implements IDebugCommandHandler{
-
- protected final DsfExecutor fExecutor;
- protected final DsfServicesTracker fTracker;
- protected static IExecutionDMContext[] EMPTY_ARRAY = new IExecutionDMContext[0];
-
- public DsfDebugViewLayoutCommand(DsfSession session) {
- fExecutor = session.getExecutor();
- fTracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), session.getId());
- }
-
- public void dispose() {
- fTracker.dispose();
- }
-
- /**
- *
- * @param request
- * @return set of IExecutionDMContext if:
- * - all elements are from a DSF session.
- * - all elements are from the same DSF session.
- */
- protected IExecutionDMContext[] getDMContexts(IDebugCommandRequest request) {
-
- HashSet<IExecutionDMContext> ret = new HashSet<>();
- String sessionId = null;
-
- for (Object obj : request.getElements()) {
- if (!(obj instanceof IDMVMContext)) {
- return EMPTY_ARRAY;
- }
-
- IDMContext dmContext = ((IDMVMContext)obj).getDMContext();
- IExecutionDMContext exeContext = DMContexts.getAncestorOfType(dmContext, IExecutionDMContext.class);
-
- if (exeContext == null) {
- return EMPTY_ARRAY;
- }
-
- // make sure all elements are from the same DSF session.
- if (sessionId == null) {
- sessionId = dmContext.getSessionId();
- }
- else {
- if (!sessionId.equals(dmContext.getSessionId())) {
- return EMPTY_ARRAY;
- }
- }
-
- ret.add(exeContext);
- }
- return ret.toArray(new IExecutionDMContext[ret.size()]);
- }
-
+public abstract class DsfDebugViewLayoutCommand implements IDebugCommandHandler {
+
+ protected final DsfExecutor fExecutor;
+ protected final DsfServicesTracker fTracker;
+ protected static IExecutionDMContext[] EMPTY_ARRAY = new IExecutionDMContext[0];
+
+ public DsfDebugViewLayoutCommand(DsfSession session) {
+ fExecutor = session.getExecutor();
+ fTracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), session.getId());
+ }
+
+ public void dispose() {
+ fTracker.dispose();
+ }
+
+ /**
+ *
+ * @param request
+ * @return set of IExecutionDMContext if:
+ * - all elements are from a DSF session.
+ * - all elements are from the same DSF session.
+ */
+ protected IExecutionDMContext[] getDMContexts(IDebugCommandRequest request) {
+
+ HashSet<IExecutionDMContext> ret = new HashSet<>();
+ String sessionId = null;
+
+ for (Object obj : request.getElements()) {
+ if (!(obj instanceof IDMVMContext)) {
+ return EMPTY_ARRAY;
+ }
+
+ IDMContext dmContext = ((IDMVMContext) obj).getDMContext();
+ IExecutionDMContext exeContext = DMContexts.getAncestorOfType(dmContext, IExecutionDMContext.class);
+
+ if (exeContext == null) {
+ return EMPTY_ARRAY;
+ }
+
+ // make sure all elements are from the same DSF session.
+ if (sessionId == null) {
+ sessionId = dmContext.getSessionId();
+ } else {
+ if (!sessionId.equals(dmContext.getSessionId())) {
+ return EMPTY_ARRAY;
+ }
+ }
+
+ ret.add(exeContext);
+ }
+ return ret.toArray(new IExecutionDMContext[ret.size()]);
+ }
+
@Override
public void canExecute(final IEnabledStateRequest request) {
final IExecutionDMContext[] executionContexts = getDMContexts(request);
if (executionContexts.length > 0 && !fExecutor.isTerminated()) {
- fExecutor.submit(new DsfRunnable() {
+ fExecutor.submit(new DsfRunnable() {
@Override
public void run() {
IExecutionContextTranslator translator = fTracker.getService(IExecutionContextTranslator.class);
if (translator != null) {
- canExecuteOnDsfThread(translator, executionContexts,
- new DataRequestMonitor<Boolean>(fExecutor, null) {
- @Override
- protected void handleCompleted() {
- boolean canExecute = isSuccess() && getData();
- request.setEnabled(canExecute);
- request.done();
- }
- });
+ canExecuteOnDsfThread(translator, executionContexts,
+ new DataRequestMonitor<Boolean>(fExecutor, null) {
+ @Override
+ protected void handleCompleted() {
+ boolean canExecute = isSuccess() && getData();
+ request.setEnabled(canExecute);
+ request.done();
+ }
+ });
} else {
request.setEnabled(false);
request.done();
}
- }
- });
- }
- else {
+ }
+ });
+ } else {
request.setEnabled(false);
request.done();
}
@@ -124,30 +122,31 @@ public abstract class DsfDebugViewLayoutCommand implements IDebugCommandHandler{
public boolean execute(final IDebugCommandRequest request) {
final IExecutionDMContext[] executionContexts = getDMContexts(request);
if (executionContexts.length > 0 && !fExecutor.isTerminated()) {
- fExecutor.submit(new DsfRunnable() {
+ fExecutor.submit(new DsfRunnable() {
@Override
public void run() {
IExecutionContextTranslator translator = fTracker.getService(IExecutionContextTranslator.class);
if (translator != null) {
- executeOnDsfThread(translator, executionContexts,
- new RequestMonitor(fExecutor, null) {
- @Override
- protected void handleCompleted() {
- request.done();
- }
- });
- }
- else {
+ executeOnDsfThread(translator, executionContexts, new RequestMonitor(fExecutor, null) {
+ @Override
+ protected void handleCompleted() {
+ request.done();
+ }
+ });
+ } else {
request.done();
}
- }
- });
+ }
+ });
return false;
}
- request.done();
+ request.done();
return true;
}
-
- abstract void executeOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts, RequestMonitor rm);
- abstract void canExecuteOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts, DataRequestMonitor<Boolean> rm);
+
+ abstract void executeOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts,
+ RequestMonitor rm);
+
+ abstract void canExecuteOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts,
+ DataRequestMonitor<Boolean> rm);
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfGroupDebugContextsCommand.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfGroupDebugContextsCommand.java
index 0888385f121..6bd15348ef5 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfGroupDebugContextsCommand.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfGroupDebugContextsCommand.java
@@ -24,18 +24,19 @@ import org.eclipse.debug.core.commands.IDebugCommandHandler;
* @since 2.2
*/
public class DsfGroupDebugContextsCommand extends DsfDebugViewLayoutCommand implements IDebugCommandHandler {
-
+
public DsfGroupDebugContextsCommand(DsfSession session) {
super(session);
- }
+ }
@Override
void executeOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts, RequestMonitor rm) {
translator.group(contexts, rm);
}
-
+
@Override
- void canExecuteOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts, DataRequestMonitor<Boolean> rm) {
+ void canExecuteOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts,
+ DataRequestMonitor<Boolean> rm) {
translator.canGroup(contexts, rm);
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfUngroupDebugContextsCommand.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfUngroupDebugContextsCommand.java
index c5943f9bde2..86eff45aac5 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfUngroupDebugContextsCommand.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/debugview/layout/actions/DsfUngroupDebugContextsCommand.java
@@ -24,10 +24,10 @@ import org.eclipse.debug.core.commands.IDebugCommandHandler;
* @since 2.2
*/
public class DsfUngroupDebugContextsCommand extends DsfDebugViewLayoutCommand implements IDebugCommandHandler {
-
- public DsfUngroupDebugContextsCommand(DsfSession session) {
- super(session);
- }
+
+ public DsfUngroupDebugContextsCommand(DsfSession session) {
+ super(session);
+ }
@Override
void executeOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts, RequestMonitor rm) {
@@ -35,7 +35,8 @@ public class DsfUngroupDebugContextsCommand extends DsfDebugViewLayoutCommand im
}
@Override
- void canExecuteOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts, DataRequestMonitor<Boolean> rm) {
+ void canExecuteOnDsfThread(IExecutionContextTranslator translator, IExecutionDMContext[] contexts,
+ DataRequestMonitor<Boolean> rm) {
translator.canUngroup(contexts, rm);
- }
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java
index f124e57cb4f..186733f8d8a 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -28,7 +28,6 @@ import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Image;
import org.osgi.framework.Bundle;
-
/**
* Abstract image registry that allows for defining fallback paths for images.
*/
@@ -36,13 +35,13 @@ public abstract class AbstractImageRegistry {
private HashMap<String, String> fPlugins = new HashMap<String, String>();
private HashMap<String, String[]> fLocations = new HashMap<String, String[]>();
private URL fBaseUrl;
- private final ImageRegistry fRegistry;
+ private final ImageRegistry fRegistry;
protected AbstractImageRegistry(Plugin plugin) {
- fRegistry = new ImageRegistry();
+ fRegistry = new ImageRegistry();
fBaseUrl = plugin.getBundle().getEntry("/"); //$NON-NLS-1$
}
-
+
/**
* Defines the key for a local image, that must be found below the icons directory
* in the plugin.
@@ -52,10 +51,10 @@ public abstract class AbstractImageRegistry {
* key.
*/
protected void localImage(String key, String dir, String name) {
- if (dir== null || dir.isEmpty())
- fLocations.put(key, new String[] {"icons/" + name}); //$NON-NLS-1$
+ if (dir == null || dir.isEmpty())
+ fLocations.put(key, new String[] { "icons/" + name }); //$NON-NLS-1$
else
- fLocations.put(key, new String[] {"icons/" + dir + "/" + name}); //$NON-NLS-1$ //$NON-NLS-2$
+ fLocations.put(key, new String[] { "icons/" + dir + "/" + name }); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -69,58 +68,58 @@ public abstract class AbstractImageRegistry {
* key.
*/
protected void externalImage(String key, String plugin, String[] dirs, String name) {
- if (plugin != null) {
- fPlugins.put(key, plugin);
- }
- String[] locations = new String[dirs.length];
- for (int i = 0; i < dirs.length; i++) {
+ if (plugin != null) {
+ fPlugins.put(key, plugin);
+ }
+ String[] locations = new String[dirs.length];
+ for (int i = 0; i < dirs.length; i++) {
String dir = dirs[i];
- if (dir== null || dir.isEmpty())
+ if (dir == null || dir.isEmpty())
locations[i] = "icons/" + name; //$NON-NLS-1$
else
locations[i] = "icons/" + dir + "/" + name; //$NON-NLS-1$ //$NON-NLS-2$
- }
- fLocations.put(key, locations);
+ }
+ fLocations.put(key, locations);
}
-
+
final public Image get(String key) {
- Image i = fRegistry.get(key);
- if (i != null) {
- return i;
- }
-
- ImageDescriptor d = createFileImageDescriptor(key);
- if (d != null) {
- fRegistry.put(key, d);
- return fRegistry.get(key);
- }
- return null;
+ Image i = fRegistry.get(key);
+ if (i != null) {
+ return i;
+ }
+
+ ImageDescriptor d = createFileImageDescriptor(key);
+ if (d != null) {
+ fRegistry.put(key, d);
+ return fRegistry.get(key);
+ }
+ return null;
}
final public ImageDescriptor getDescriptor(String key) {
- ImageDescriptor d = fRegistry.getDescriptor(key);
- if (d != null) {
- return d;
- }
-
- d = createFileImageDescriptor(key);
- if (d != null) {
- fRegistry.put(key, d);
- return d;
- }
- return null;
+ ImageDescriptor d = fRegistry.getDescriptor(key);
+ if (d != null) {
+ return d;
+ }
+
+ d = createFileImageDescriptor(key);
+ if (d != null) {
+ fRegistry.put(key, d);
+ return d;
+ }
+ return null;
}
private ImageDescriptor createFileImageDescriptor(String key) {
URL url = fBaseUrl;
String pluginId = fPlugins.get(key);
if (pluginId != null) {
- Bundle bundle= Platform.getBundle(pluginId);
+ Bundle bundle = Platform.getBundle(pluginId);
if (bundle != null) {
url = bundle.getEntry("/"); //$NON-NLS-1$
}
}
- String[] locations= fLocations.get(key);
+ String[] locations = fLocations.get(key);
if (locations != null) {
for (int i = 0; i < locations.length; i++) {
String loc = locations[i];
@@ -132,13 +131,14 @@ public abstract class AbstractImageRegistry {
return candidate;
}
} catch (MalformedURLException e) {
- DsfUIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, "Malformed Icon URL", e)); //$NON-NLS-1$
+ DsfUIPlugin.getDefault().getLog()
+ .log(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, "Malformed Icon URL", e)); //$NON-NLS-1$
} catch (SWTException e) {
// try the next one.
}
}
}
- return null;
+ return null;
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java
index e74c1500334..7c4263ded50 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -34,10 +34,11 @@ import org.eclipse.swt.SWT;
/**
* A vertical ruler column to display the instruction address.
*/
-public class AddressRulerColumn extends DisassemblyRulerColumn implements IVerticalRulerInfo, IVerticalRulerInfoExtension, IAnnotationHover {
+public class AddressRulerColumn extends DisassemblyRulerColumn
+ implements IVerticalRulerInfo, IVerticalRulerInfoExtension, IAnnotationHover {
public static final String ID = "org.eclipse.cdt.dsf.ui.disassemblyColumn.address"; //$NON-NLS-1$
-
+
private int fRadix;
private boolean fShowRadixPrefix;
private String fRadixPrefix;
@@ -58,7 +59,7 @@ public class AddressRulerColumn extends DisassemblyRulerColumn implements IVerti
@Override
protected String createDisplayString(int line) {
- DisassemblyDocument doc = (DisassemblyDocument)getParentRuler().getTextViewer().getDocument();
+ DisassemblyDocument doc = (DisassemblyDocument) getParentRuler().getTextViewer().getDocument();
int offset;
try {
offset = doc.getLineOffset(line);
@@ -76,16 +77,16 @@ public class AddressRulerColumn extends DisassemblyRulerColumn implements IVerti
int nLines;
if (srcPos.fFileInfo.fSource == null) {
srcLine = srcPos.fLine;
- nLines = srcLine+1;
+ nLines = srcLine + 1;
} else {
- int delta = offset-srcPos.offset;
- int baseOffset = srcPos.fFileInfo.fSource.getLineOffset(srcPos.fLine);
- srcLine = srcPos.fFileInfo.fSource.getLineOfOffset(baseOffset+delta);
+ int delta = offset - srcPos.offset;
+ int baseOffset = srcPos.fFileInfo.fSource.getLineOffset(srcPos.fLine);
+ srcLine = srcPos.fFileInfo.fSource.getLineOfOffset(baseOffset + delta);
nLines = srcPos.fFileInfo.fSource.getNumberOfLines();
}
- String digitStr = Integer.toString(srcLine+1);
- int maxDigits = (int)(Math.log(nLines)/Math.log(10))+1;
- return SPACES.substring(0, maxDigits-digitStr.length())+digitStr;
+ String digitStr = Integer.toString(srcLine + 1);
+ int maxDigits = (int) (Math.log(nLines) / Math.log(10)) + 1;
+ return SPACES.substring(0, maxDigits - digitStr.length()) + digitStr;
}
} catch (BadLocationException e) {
// silently ignored
@@ -99,20 +100,20 @@ public class AddressRulerColumn extends DisassemblyRulerColumn implements IVerti
}
public void setAddressSize(int bits) {
- fAddressSize= bits;
+ fAddressSize = bits;
calculateNumberOfDigits();
}
public void setRadix(int radix) {
- fRadix= radix;
+ fRadix = radix;
calculateNumberOfDigits();
setShowRadixPrefix(fShowRadixPrefix);
}
private void calculateNumberOfDigits() {
- fNumberOfDigits= BigInteger.ONE.shiftLeft(fAddressSize).subtract(BigInteger.ONE).toString(fRadix).length();
+ fNumberOfDigits = BigInteger.ONE.shiftLeft(fAddressSize).subtract(BigInteger.ONE).toString(fRadix).length();
}
-
+
public void setShowRadixPrefix(boolean showRadixPrefix) {
fShowRadixPrefix = showRadixPrefix;
if (!fShowRadixPrefix) {
@@ -132,7 +133,7 @@ public class AddressRulerColumn extends DisassemblyRulerColumn implements IVerti
buf.append(fRadixPrefix);
}
String str = address.toString(fRadix);
- for (int i=str.length(); i<fNumberOfDigits; ++i)
+ for (int i = str.length(); i < fNumberOfDigits; ++i)
buf.append('0');
buf.append(str);
buf.append(':');
@@ -169,7 +170,7 @@ public class AddressRulerColumn extends DisassemblyRulerColumn implements IVerti
@Override
public String getHoverInfo(ISourceViewer sourceViewer, int line) {
- DisassemblyDocument doc = (DisassemblyDocument)getParentRuler().getTextViewer().getDocument();
+ DisassemblyDocument doc = (DisassemblyDocument) getParentRuler().getTextViewer().getDocument();
BigInteger address = doc.getAddressOfLine(line);
SourceFileInfo info = doc.getSourceInfo(address);
if (info != null) {
@@ -180,7 +181,7 @@ public class AddressRulerColumn extends DisassemblyRulerColumn implements IVerti
@Override
public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
+ String property = event.getProperty();
IPreferenceStore store = getPreferenceStore();
boolean needRedraw = false;
if (DisassemblyPreferenceConstants.ADDRESS_COLOR.equals(property)) {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
index b0db007bfb4..39951bb03e1 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
@@ -97,7 +97,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
*/
public DisassemblyBackendDsf() {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#init(org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback)
*/
@@ -115,43 +115,43 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
DsfSession.removeSessionEndedListener(this);
}
- public static boolean supportsDebugContext_(IAdaptable context) {
- IDMVMContext dmvmContext = context.getAdapter(IDMVMContext.class);
- return dmvmContext != null && hasDisassemblyService(dmvmContext.getDMContext());
- }
-
- private static boolean hasDisassemblyService(final IDMContext dmContext) {
- DsfSession session = DsfSession.getSession(dmContext.getSessionId());
- if (session == null || !session.isActive()) {
- return false;
- }
- if (session.getExecutor().isInExecutorThread()) {
- DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), session.getId());
- IDisassembly disassSvc = tracker.getService(IDisassembly.class);
- tracker.dispose();
- return disassSvc != null;
- }
- Query<Boolean> query = new Query<Boolean>() {
- @Override
- protected void execute(DataRequestMonitor<Boolean> rm) {
- try {
- rm.setData(hasDisassemblyService(dmContext));
- } finally {
- rm.done();
- }
- }
- };
- try {
- session.getExecutor().execute(query);
- Boolean result = query.get(1, TimeUnit.SECONDS);
- return result != null && result.booleanValue();
- } catch (Exception exc) {
- // ignored on purpose
- }
- return false;
- }
-
- /* (non-Javadoc)
+ public static boolean supportsDebugContext_(IAdaptable context) {
+ IDMVMContext dmvmContext = context.getAdapter(IDMVMContext.class);
+ return dmvmContext != null && hasDisassemblyService(dmvmContext.getDMContext());
+ }
+
+ private static boolean hasDisassemblyService(final IDMContext dmContext) {
+ DsfSession session = DsfSession.getSession(dmContext.getSessionId());
+ if (session == null || !session.isActive()) {
+ return false;
+ }
+ if (session.getExecutor().isInExecutorThread()) {
+ DsfServicesTracker tracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), session.getId());
+ IDisassembly disassSvc = tracker.getService(IDisassembly.class);
+ tracker.dispose();
+ return disassSvc != null;
+ }
+ Query<Boolean> query = new Query<Boolean>() {
+ @Override
+ protected void execute(DataRequestMonitor<Boolean> rm) {
+ try {
+ rm.setData(hasDisassemblyService(dmContext));
+ } finally {
+ rm.done();
+ }
+ }
+ };
+ try {
+ session.getExecutor().execute(query);
+ Boolean result = query.get(1, TimeUnit.SECONDS);
+ return result != null && result.booleanValue();
+ } catch (Exception exc) {
+ // ignored on purpose
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#supportsDebugContext(org.eclipse.core.runtime.IAdaptable)
*/
@Override
@@ -175,18 +175,19 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
assert supportsDebugContext(context) : "caller should not have invoked us"; //$NON-NLS-1$
IDMVMContext vmContext = context.getAdapter(IDMVMContext.class);
IDMContext dmContext = vmContext.getDMContext();
-
+
SetDebugContextResult result = new SetDebugContextResult();
-
+
String dsfSessionId = dmContext.getSessionId();
-
+
if (!dsfSessionId.equals(fDsfSessionId)) {
// switch to different session or initiate session
if (DEBUG) {
- System.out.println(MessageFormat.format("DisassemblyBackendDsf: switch session [{0}<<{1}]. Input context={2}", dsfSessionId, //$NON-NLS-1$
- fDsfSessionId, dmContext));
+ System.out.println(MessageFormat.format(
+ "DisassemblyBackendDsf: switch session [{0}<<{1}]. Input context={2}", dsfSessionId, //$NON-NLS-1$
+ fDsfSessionId, dmContext));
}
- fTargetContext= null;
+ fTargetContext = null;
fTargetFrameContext = null;
result.contextChanged = true;
@@ -194,29 +195,30 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
if (dmContext instanceof IFrameDMContext) {
fTargetFrameContext = (IFrameDMContext) dmContext;
}
- IExecutionDMContext executionContext= DMContexts.getAncestorOfType(dmContext, IExecutionDMContext.class);
+ IExecutionDMContext executionContext = DMContexts.getAncestorOfType(dmContext,
+ IExecutionDMContext.class);
if (executionContext != null) {
- fTargetContext= executionContext;
+ fTargetContext = executionContext;
}
}
if (fTargetContext != null) {
-
+
// remove ourselves as a listener with the previous session (context)
- if (fDsfSessionId != null) {
- final DsfSession prevSession = DsfSession.getSession(fDsfSessionId);
- if (prevSession != null) {
- try {
- prevSession.getExecutor().execute(new DsfRunnable() {
- @Override
+ if (fDsfSessionId != null) {
+ final DsfSession prevSession = DsfSession.getSession(fDsfSessionId);
+ if (prevSession != null) {
+ try {
+ prevSession.getExecutor().execute(new DsfRunnable() {
+ @Override
public void run() {
- prevSession.removeServiceEventListener(DisassemblyBackendDsf.this);
- }
- });
- } catch (RejectedExecutionException e) {
- // Session is shut down.
- }
+ prevSession.removeServiceEventListener(DisassemblyBackendDsf.this);
+ }
+ });
+ } catch (RejectedExecutionException e) {
+ // Session is shut down.
+ }
}
- }
+ }
// Ensures the view will display 'No Debug Context'
if (fTargetFrameContext != null) {
result.sessionId = fDsfSessionId = dsfSessionId;
@@ -227,27 +229,27 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
if (fServicesTracker != null) {
fServicesTracker.dispose();
}
- fServicesTracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fDsfSessionId);
-
+ fServicesTracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), fDsfSessionId);
+
// add ourselves as a listener with the new session (context)
- final DsfSession newSession = DsfSession.getSession(dsfSessionId);
- if (newSession != null) {
- try {
- newSession.getExecutor().execute(new DsfRunnable() {
- @Override
+ final DsfSession newSession = DsfSession.getSession(dsfSessionId);
+ if (newSession != null) {
+ try {
+ newSession.getExecutor().execute(new DsfRunnable() {
+ @Override
public void run() {
- newSession.addServiceEventListener(DisassemblyBackendDsf.this, null);
- }
- });
- } catch (RejectedExecutionException e) {
- // Session is shut down.
- }
+ newSession.addServiceEventListener(DisassemblyBackendDsf.this, null);
+ }
+ });
+ } catch (RejectedExecutionException e) {
+ // Session is shut down.
+ }
}
}
} else if (dmContext instanceof IFrameDMContext) {
result.sessionId = fDsfSessionId;
// switch to different frame
- IFrameDMContext frame= (IFrameDMContext) dmContext;
+ IFrameDMContext frame = (IFrameDMContext) dmContext;
IExecutionDMContext newExeDmc = DMContexts.getAncestorOfType(frame, IExecutionDMContext.class);
if (newExeDmc != null) {
if (fTargetFrameContext != null) {
@@ -260,12 +262,12 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
// If switching from a thread node to a frame node
result.contextChanged = true;
}
- fTargetContext= newExeDmc;
- fTargetFrameContext= frame;
+ fTargetContext = newExeDmc;
+ fTargetFrameContext = frame;
if (!result.contextChanged) {
fCallback.gotoFrameIfActive(frame.getLevel());
}
- } else {
+ } else {
fTargetContext = null;
fTargetFrameContext = null;
result.contextChanged = true;
@@ -279,15 +281,15 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
} else if (dmContext.equals(fTargetContext) && canDisassemble()) {
result.contextChanged = false;
result.sessionId = fDsfSessionId;
- } else {
+ } else {
fTargetContext = null;
fTargetFrameContext = null;
result.contextChanged = true;
}
if (DEBUG) {
System.out.println(MessageFormat.format(
- "DisassemblyBackendDsf: switch session done [id={0};context={1};\n\t\t\tframe={2}].\n\t\t\tInput context={3}", //$NON-NLS-1$
- fDsfSessionId, fTargetContext, fTargetFrameContext, dmContext));
+ "DisassemblyBackendDsf: switch session done [id={0};context={1};\n\t\t\tframe={2}].\n\t\t\tInput context={3}", //$NON-NLS-1$
+ fDsfSessionId, fTargetContext, fTargetFrameContext, dmContext));
}
return result;
}
@@ -306,14 +308,14 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
session.removeServiceEventListener(DisassemblyBackendDsf.this);
}
});
- } catch (RejectedExecutionException e) {
- // Session is shut down.
- }
+ } catch (RejectedExecutionException e) {
+ // Session is shut down.
+ }
}
- fTargetContext= null;
+ fTargetContext = null;
if (fServicesTracker != null) {
- fServicesTracker.dispose();
- fServicesTracker= null;
+ fServicesTracker.dispose();
+ fServicesTracker = null;
}
}
@@ -322,17 +324,18 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
*/
@Override
public void retrieveFrameAddress(final int frame) {
- final DsfExecutor executor= getSession().getExecutor();
+ final DsfExecutor executor = getSession().getExecutor();
executor.execute(new DsfRunnable() {
@Override
public void run() {
retrieveFrameAddressInSessionThread(frame);
- }});
+ }
+ });
}
void retrieveFrameAddressInSessionThread(final int frame) {
- final IStack stack= fServicesTracker.getService(IStack.class);
- final DsfExecutor executor= getSession().getExecutor();
+ final IStack stack = fServicesTracker.getService(IStack.class);
+ final DsfExecutor executor = getSession().getExecutor();
// Our frame context is currently either un-set or it's set to the frame
// our caller is specifying. If un-set, then set it and reinvoke this
@@ -342,7 +345,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
stack.getTopFrame(fTargetContext, new DataRequestMonitor<IFrameDMContext>(executor, null) {
@Override
protected void handleCompleted() {
- fTargetFrameContext= getData();
+ fTargetFrameContext = getData();
if (fTargetFrameContext != null) {
retrieveFrameAddressInSessionThread(frame);
} else {
@@ -363,26 +366,27 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
});
} else {
// TODO retrieve other stack frame
- fCallback.setUpdatePending(false);
+ fCallback.setUpdatePending(false);
}
return;
- }
- else if (frame != fTargetFrameContext.getLevel()) {
- // frame context has changed in the meantime - reinvoke
- retrieveFrameAddressInSessionThread(fTargetFrameContext.getLevel());
+ } else if (frame != fTargetFrameContext.getLevel()) {
+ // frame context has changed in the meantime - reinvoke
+ retrieveFrameAddressInSessionThread(fTargetFrameContext.getLevel());
return;
}
-
+
stack.getFrameData(fTargetFrameContext, new DataRequestMonitor<IFrameDMData>(executor, null) {
@Override
protected void handleCompleted() {
fCallback.setUpdatePending(false);
- IFrameDMData frameData= getData();
- fTargetFrameData= frameData;
+ IFrameDMData frameData = getData();
+ fTargetFrameData = frameData;
if (!isCanceled() && frameData != null) {
- final IAddress address= frameData.getAddress();
- final BigInteger addressValue= address.getValue();
- if (DEBUG) System.out.println("retrieveFrameAddress done "+ DisassemblyUtils.getAddressText(addressValue)); //$NON-NLS-1$
+ final IAddress address = frameData.getAddress();
+ final BigInteger addressValue = address.getValue();
+ if (DEBUG)
+ System.out
+ .println("retrieveFrameAddress done " + DisassemblyUtils.getAddressText(addressValue)); //$NON-NLS-1$
fCallback.asyncExec(new Runnable() {
@Override
public void run() {
@@ -397,7 +401,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
}
});
} else {
- final IStatus status= getStatus();
+ final IStatus status = getStatus();
if (status != null && !status.isOK()) {
DisassemblyBackendDsf.this.handleError(getStatus());
}
@@ -444,7 +448,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
} catch (InterruptedException exc) {
} catch (ExecutionException exc) {
}
-
+
return false;
}
@@ -455,29 +459,27 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
private IRunControl getRunControl() {
return getService(IRunControl.class);
}
-
+
private <V> V getService(Class<V> serviceClass) {
if (fServicesTracker != null) {
return fServicesTracker.getService(serviceClass);
}
return null;
}
-
-
@DsfServiceEventHandler
public void handleEvent(IExitedDMEvent event) {
if (fTargetContext == null) {
return;
}
- final IExecutionDMContext context= event.getDMContext();
- if (context.equals(fTargetContext)
- || DMContexts.isAncestorOf(fTargetContext, context)) {
+ final IExecutionDMContext context = event.getDMContext();
+ if (context.equals(fTargetContext) || DMContexts.isAncestorOf(fTargetContext, context)) {
fCallback.asyncExec(new Runnable() {
@Override
public void run() {
fCallback.handleTargetEnded();
- }});
+ }
+ });
}
}
@@ -486,9 +488,8 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
if (fTargetContext == null) {
return;
}
- final IExecutionDMContext context= event.getDMContext();
- if (context.equals(fTargetContext)
- || DMContexts.isAncestorOf(fTargetContext, context)) {
+ final IExecutionDMContext context = event.getDMContext();
+ if (context.equals(fTargetContext) || DMContexts.isAncestorOf(fTargetContext, context)) {
fCallback.handleTargetSuspended();
}
}
@@ -498,9 +499,8 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
if (fTargetContext == null) {
return;
}
- final IExecutionDMContext context= event.getDMContext();
- if (context.equals(fTargetContext)
- || DMContexts.isAncestorOf(fTargetContext, context)) {
+ final IExecutionDMContext context = event.getDMContext();
+ if (context.equals(fTargetContext) || DMContexts.isAncestorOf(fTargetContext, context)) {
fCallback.handleTargetResumed();
}
}
@@ -526,7 +526,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
}
return -1;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#hasFrameContext()
*/
@@ -534,7 +534,6 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
public boolean hasFrameContext() {
return fTargetFrameContext != null;
}
-
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#getFrameFile()
@@ -556,64 +555,72 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyBackend#retrieveDisassembly(java.math.BigInteger, java.math.BigInteger, java.lang.String, int, int, boolean, boolean, boolean, int)
*/
@Override
- public void retrieveDisassembly(final BigInteger startAddress, BigInteger endAddress, final String file, final int lineNumber, final int lines, final boolean mixed, final boolean showSymbols, final boolean showDisassembly, final int linesHint) {
+ public void retrieveDisassembly(final BigInteger startAddress, BigInteger endAddress, final String file,
+ final int lineNumber, final int lines, final boolean mixed, final boolean showSymbols,
+ final boolean showDisassembly, final int linesHint) {
// make sure address range is no less than 32 bytes
// this is an attempt to get better a response from the backend (bug 302505)
- final BigInteger finalEndAddress= startAddress.add(BigInteger.valueOf(32)).max(endAddress);
+ final BigInteger finalEndAddress = startAddress.add(BigInteger.valueOf(32)).max(endAddress);
DsfSession session = getSession();
if (session == null) {
- return; // can happen during session termination
+ return; // can happen during session termination
}
-
- final DsfExecutor executor= session.getExecutor();
- final IDisassemblyDMContext context= DMContexts.getAncestorOfType(fTargetContext, IDisassemblyDMContext.class);
-
+ final DsfExecutor executor = session.getExecutor();
+ final IDisassemblyDMContext context = DMContexts.getAncestorOfType(fTargetContext, IDisassemblyDMContext.class);
+
// align the start address first (bug 328168)
- executor.execute(new Runnable() {
+ executor.execute(new Runnable() {
@Override
public void run() {
alignOpCodeAddress(startAddress, new DataRequestMonitor<BigInteger>(executor, null) {
-
+
@Override
public void handleCompleted() {
final BigInteger finalStartAddress = getData();
if (mixed) {
- final DataRequestMonitor<IMixedInstruction[]> disassemblyRequest= new DataRequestMonitor<IMixedInstruction[]>(executor, null) {
+ final DataRequestMonitor<IMixedInstruction[]> disassemblyRequest = new DataRequestMonitor<IMixedInstruction[]>(
+ executor, null) {
@Override
public void handleCompleted() {
- final IMixedInstruction[] data= getData();
+ final IMixedInstruction[] data = getData();
if (!isCanceled() && data != null) {
fCallback.asyncExec(new Runnable() {
@Override
public void run() {
- if (!insertDisassembly(finalStartAddress, finalEndAddress, data, showSymbols, showDisassembly)) {
+ if (!insertDisassembly(finalStartAddress, finalEndAddress, data,
+ showSymbols, showDisassembly)) {
// retry in non-mixed mode
- fCallback.retrieveDisassembly(finalStartAddress, finalEndAddress, linesHint, false, true);
+ fCallback.retrieveDisassembly(finalStartAddress, finalEndAddress,
+ linesHint, false, true);
}
- }});
+ }
+ });
} else {
- final IStatus status= getStatus();
+ final IStatus status = getStatus();
if (status != null && !status.isOK()) {
- if( file != null ) {
+ if (file != null) {
fCallback.asyncExec(new Runnable() {
@Override
public void run() {
- fCallback.retrieveDisassembly(finalStartAddress, finalEndAddress, linesHint, true, true);
- }});
- }
- else {
+ fCallback.retrieveDisassembly(finalStartAddress,
+ finalEndAddress, linesHint, true, true);
+ }
+ });
+ } else {
fCallback.asyncExec(new Runnable() {
@Override
public void run() {
fCallback.doScrollLocked(new Runnable() {
@Override
public void run() {
- fCallback.insertError(finalStartAddress, status.getMessage());
+ fCallback.insertError(finalStartAddress,
+ status.getMessage());
}
});
- }});
+ }
+ });
}
}
fCallback.setUpdatePending(false);
@@ -624,46 +631,56 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
executor.execute(new Runnable() {
@Override
public void run() {
- final IDisassembly disassembly= fServicesTracker.getService(IDisassembly.class);
+ final IDisassembly disassembly = fServicesTracker
+ .getService(IDisassembly.class);
if (disassembly == null) {
disassemblyRequest.cancel();
disassemblyRequest.done();
return;
}
- disassembly.getMixedInstructions(context, file, lineNumber, lines*2, disassemblyRequest);
- }});
+ disassembly.getMixedInstructions(context, file, lineNumber, lines * 2,
+ disassemblyRequest);
+ }
+ });
} else {
executor.execute(new Runnable() {
@Override
public void run() {
- final IDisassembly disassembly= fServicesTracker.getService(IDisassembly.class);
+ final IDisassembly disassembly = fServicesTracker
+ .getService(IDisassembly.class);
if (disassembly == null) {
disassemblyRequest.cancel();
disassemblyRequest.done();
return;
}
- disassembly.getMixedInstructions(context, finalStartAddress, finalEndAddress, disassemblyRequest);
- }});
+ disassembly.getMixedInstructions(context, finalStartAddress, finalEndAddress,
+ disassemblyRequest);
+ }
+ });
}
} else {
- final DataRequestMonitor<IInstruction[]> disassemblyRequest= new DataRequestMonitor<IInstruction[]>(executor, null) {
+ final DataRequestMonitor<IInstruction[]> disassemblyRequest = new DataRequestMonitor<IInstruction[]>(
+ executor, null) {
@Override
public void handleCompleted() {
if (!isCanceled() && getData() != null) {
fCallback.asyncExec(new Runnable() {
@Override
public void run() {
- if (!insertDisassembly(finalStartAddress, finalEndAddress, getData(), showSymbols, showDisassembly)) {
+ if (!insertDisassembly(finalStartAddress, finalEndAddress, getData(),
+ showSymbols, showDisassembly)) {
fCallback.doScrollLocked(new Runnable() {
@Override
public void run() {
- fCallback.insertError(finalStartAddress, DisassemblyMessages.DisassemblyBackendDsf_error_UnableToRetrieveData);
+ fCallback.insertError(finalStartAddress,
+ DisassemblyMessages.DisassemblyBackendDsf_error_UnableToRetrieveData);
}
});
}
- }});
+ }
+ });
} else {
- final IStatus status= getStatus();
+ final IStatus status = getStatus();
if (status != null && !status.isOK()) {
fCallback.asyncExec(new Runnable() {
@Override
@@ -671,10 +688,12 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
fCallback.doScrollLocked(new Runnable() {
@Override
public void run() {
- fCallback.insertError(finalStartAddress, status.getMessage());
+ fCallback.insertError(finalStartAddress,
+ status.getMessage());
}
});
- }});
+ }
+ });
}
fCallback.setUpdatePending(false);
}
@@ -683,14 +702,16 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
executor.execute(new Runnable() {
@Override
public void run() {
- final IDisassembly disassembly= fServicesTracker.getService(IDisassembly.class);
+ final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
if (disassembly == null) {
disassemblyRequest.cancel();
disassemblyRequest.done();
return;
}
- disassembly.getInstructions(context, finalStartAddress, finalEndAddress, disassemblyRequest);
- }});
+ disassembly.getInstructions(context, finalStartAddress, finalEndAddress,
+ disassemblyRequest);
+ }
+ });
}
}
});
@@ -698,20 +719,22 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
});
}
- private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IInstruction[] instructions, boolean showSymbols, boolean showDisassembly) {
- if (!fCallback.hasViewer() || fDsfSessionId == null || fTargetContext == null) {
- if (DEBUG) {
- System.out.println(MessageFormat.format(
+ private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IInstruction[] instructions,
+ boolean showSymbols, boolean showDisassembly) {
+ if (!fCallback.hasViewer() || fDsfSessionId == null || fTargetContext == null) {
+ if (DEBUG) {
+ System.out.println(MessageFormat.format(
"insertDisassembly ignored at {0} due to missing context: [fDsfSessionId={1};fTargetContext={2}]", //$NON-NLS-1$
DisassemblyUtils.getAddressText(startAddress), fDsfSessionId, fTargetContext));
- }
- if (fTargetContext == null) {
- fCallback.setUpdatePending(false);
- }
+ }
+ if (fTargetContext == null) {
+ fCallback.setUpdatePending(false);
+ }
// return true to avoid a retry
return true;
}
- if (DEBUG) System.out.println("insertDisassembly "+ DisassemblyUtils.getAddressText(startAddress)); //$NON-NLS-1$
+ if (DEBUG)
+ System.out.println("insertDisassembly " + DisassemblyUtils.getAddressText(startAddress)); //$NON-NLS-1$
assert fCallback.getUpdatePending();
if (!fCallback.getUpdatePending()) {
// safe-guard in case something weird is going on
@@ -723,11 +746,11 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
try {
fCallback.lockScroller();
-
- AddressRangePosition p= null;
+
+ AddressRangePosition p = null;
for (int j = 0; j < instructions.length; j++) {
IInstruction instruction = instructions[j];
- BigInteger address= instruction.getAdress();
+ BigInteger address = instruction.getAdress();
if (startAddress == null || startAddress.compareTo(BigInteger.ZERO) < 0) {
startAddress = address;
fCallback.setGotoAddressPending(address);
@@ -739,10 +762,12 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
p.fValid = false;
fCallback.getDocument().addInvalidAddressRange(p);
} else if (p == null || address.compareTo(endAddress) > 0) {
- if (DEBUG) System.out.println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
+ if (DEBUG)
+ System.out.println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
return insertedAnyAddress;
} else if (p.fValid) {
- if (DEBUG) System.out.println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
+ if (DEBUG)
+ System.out.println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
if (!p.fAddressOffset.equals(address)) {
// override probably unaligned disassembly
p.fValid = false;
@@ -751,21 +776,22 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
continue;
}
}
- boolean hasSource= false;
- String compilationPath= null;
+ boolean hasSource = false;
+ String compilationPath = null;
// insert symbol label
- final String functionName= instruction.getFuntionName();
+ final String functionName = instruction.getFuntionName();
if (functionName != null && !functionName.isEmpty() && instruction.getOffset() == 0) {
- p = fCallback.getDocument().insertLabel(p, address, functionName, showSymbols && (!hasSource || showDisassembly));
+ p = fCallback.getDocument().insertLabel(p, address, functionName,
+ showSymbols && (!hasSource || showDisassembly));
}
// determine instruction byte length
- BigInteger instrLength= null;
+ BigInteger instrLength = null;
if (instruction instanceof IInstructionWithSize
- && ((IInstructionWithSize)instruction).getSize() != null) {
- instrLength= new BigInteger(((IInstructionWithSize)instruction).getSize().toString());
+ && ((IInstructionWithSize) instruction).getSize() != null) {
+ instrLength = new BigInteger(((IInstructionWithSize) instruction).getSize().toString());
} else {
if (j < instructions.length - 1) {
- instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
+ instrLength = instructions[j + 1].getAdress().subtract(instruction.getAdress()).abs();
}
if (instrLength == null) {
// cannot determine length of last instruction
@@ -775,18 +801,19 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
final String functionOffset; // Renamed from opCode to avoid confusion
// insert function name+offset instead of opcode bytes
if (functionName != null && !functionName.isEmpty()) {
- functionOffset= functionName + '+' + instruction.getOffset();
+ functionOffset = functionName + '+' + instruction.getOffset();
} else {
- functionOffset= ""; //$NON-NLS-1$
+ functionOffset = ""; //$NON-NLS-1$
}
-
+
BigInteger opCodes = null;
// Get raw Opcodes if available
- if(instruction instanceof IInstructionWithRawOpcodes){
- opCodes = ((IInstructionWithRawOpcodes)instruction).getRawOpcodes();
+ if (instruction instanceof IInstructionWithRawOpcodes) {
+ opCodes = ((IInstructionWithRawOpcodes) instruction).getRawOpcodes();
}
- p = fCallback.getDocument().insertDisassemblyLine(p, address, instrLength.intValue(), functionOffset, opCodes, instruction.getInstruction(), compilationPath, -1);
+ p = fCallback.getDocument().insertDisassemblyLine(p, address, instrLength.intValue(), functionOffset,
+ opCodes, instruction.getInstruction(), compilationPath, -1);
if (p == null) {
break;
}
@@ -814,7 +841,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
* an address the caller is hoping will be covered by this
* insertion. I.e., [mixedInstructions] 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,
+ * 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
* as long as any instruction was inserted
* @param endAddress
@@ -825,20 +852,22 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
* @param showDisassembly
* @return whether [startAddress] was inserted
*/
- private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IMixedInstruction[] mixedInstructions, boolean showSymbols, boolean showDisassembly) {
- if (!fCallback.hasViewer() || fDsfSessionId == null || fTargetContext == null) {
- if (DEBUG) {
- System.out.println(MessageFormat.format(
+ private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress,
+ IMixedInstruction[] mixedInstructions, boolean showSymbols, boolean showDisassembly) {
+ if (!fCallback.hasViewer() || fDsfSessionId == null || fTargetContext == null) {
+ if (DEBUG) {
+ System.out.println(MessageFormat.format(
"insertDisassembly ignored at {0} : missing context: [fDsfSessionId={1};fTargetContext={2}]", //$NON-NLS-1$
DisassemblyUtils.getAddressText(startAddress), fDsfSessionId, fTargetContext));
- }
- if (fTargetContext == null) {
- fCallback.setUpdatePending(false);
- }
+ }
+ if (fTargetContext == null) {
+ fCallback.setUpdatePending(false);
+ }
// return true to avoid a retry
return true;
}
- if (DEBUG) System.out.println("insertDisassembly "+ DisassemblyUtils.getAddressText(startAddress)); //$NON-NLS-1$
+ if (DEBUG)
+ System.out.println("insertDisassembly " + DisassemblyUtils.getAddressText(startAddress)); //$NON-NLS-1$
boolean updatePending = fCallback.getUpdatePending();
assert updatePending;
if (!updatePending) {
@@ -850,16 +879,16 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
boolean insertedAnyAddress = false;
try {
fCallback.lockScroller();
-
- AddressRangePosition p= null;
+
+ AddressRangePosition p = null;
for (int i = 0; i < mixedInstructions.length; ++i) {
- IMixedInstruction mixedInstruction= mixedInstructions[i];
- final String file= mixedInstruction.getFileName();
- int lineNumber= mixedInstruction.getLineNumber() - 1;
- IInstruction[] instructions= mixedInstruction.getInstructions();
+ IMixedInstruction mixedInstruction = mixedInstructions[i];
+ final String file = mixedInstruction.getFileName();
+ int lineNumber = mixedInstruction.getLineNumber() - 1;
+ IInstruction[] instructions = mixedInstruction.getInstructions();
for (int j = 0; j < instructions.length; ++j) {
IInstruction instruction = instructions[j];
- BigInteger address= instruction.getAdress();
+ BigInteger address = instruction.getAdress();
if (startAddress == null) {
startAddress = address;
fCallback.setGotoAddressPending(address);
@@ -871,10 +900,14 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
p.fValid = false;
fCallback.getDocument().addInvalidAddressRange(p);
} else if (p == null || address.compareTo(endAddress) > 0) {
- if (DEBUG) System.out.println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
+ if (DEBUG)
+ System.out
+ .println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
return insertedAnyAddress;
} else if (p.fValid) {
- if (DEBUG) System.out.println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
+ if (DEBUG)
+ System.out
+ .println("Excess disassembly lines at " + DisassemblyUtils.getAddressText(address)); //$NON-NLS-1$
if (!p.fAddressOffset.equals(address)) {
// override probably unaligned disassembly
p.fValid = false;
@@ -883,30 +916,31 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
continue;
}
}
- boolean hasSource= false;
+ boolean hasSource = false;
if (file != null && lineNumber >= 0) {
p = fCallback.insertSource(p, address, file, lineNumber);
hasSource = fCallback.getStorageForFile(file) != null;
}
// insert symbol label
- final String functionName= instruction.getFuntionName();
+ final String functionName = instruction.getFuntionName();
if (functionName != null && !functionName.isEmpty() && instruction.getOffset() == 0) {
- p = fCallback.getDocument().insertLabel(p, address, functionName, showSymbols && (!hasSource || showDisassembly));
+ p = fCallback.getDocument().insertLabel(p, address, functionName,
+ showSymbols && (!hasSource || showDisassembly));
}
// determine instruction byte length
- BigInteger instrLength= null;
+ BigInteger instrLength = null;
if (instruction instanceof IInstructionWithSize
- && ((IInstructionWithSize)instruction).getSize() != null) {
- instrLength= new BigInteger(((IInstructionWithSize)instruction).getSize().toString());
+ && ((IInstructionWithSize) instruction).getSize() != null) {
+ instrLength = new BigInteger(((IInstructionWithSize) instruction).getSize().toString());
} else {
if (j < instructions.length - 1) {
- instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs();
+ instrLength = instructions[j + 1].getAdress().subtract(instruction.getAdress()).abs();
} else if (i < mixedInstructions.length - 1) {
- int nextSrcLineIdx= i+1;
+ int nextSrcLineIdx = i + 1;
while (nextSrcLineIdx < mixedInstructions.length) {
- IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions();
+ IInstruction[] nextInstrs = mixedInstructions[nextSrcLineIdx].getInstructions();
if (nextInstrs.length > 0) {
- instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs();
+ instrLength = nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs();
break;
}
++nextSrcLineIdx;
@@ -923,24 +957,25 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
final String funcOffset;
// insert function name+offset instead of opcode bytes
if (functionName != null && !functionName.isEmpty()) {
- funcOffset= functionName + '+' + instruction.getOffset();
+ funcOffset = functionName + '+' + instruction.getOffset();
} else {
- funcOffset= ""; //$NON-NLS-1$
+ funcOffset = ""; //$NON-NLS-1$
}
-
+
BigInteger opCodes = null;
- if(instruction instanceof IInstructionWithRawOpcodes){
- opCodes = ((IInstructionWithRawOpcodes)instruction).getRawOpcodes();
+ if (instruction instanceof IInstructionWithRawOpcodes) {
+ opCodes = ((IInstructionWithRawOpcodes) instruction).getRawOpcodes();
}
-
- p = fCallback.getDocument().insertDisassemblyLine(p, address, instrLength.intValue(), funcOffset, opCodes, instruction.getInstruction(), file, lineNumber);
+
+ p = fCallback.getDocument().insertDisassemblyLine(p, address, instrLength.intValue(), funcOffset,
+ opCodes, instruction.getInstruction(), file, lineNumber);
if (p == null) {
break;
}
insertedAnyAddress = true;
}
}
-
+
} catch (BadLocationException e) {
// should not happen
DisassemblyUtils.internalError(e);
@@ -964,25 +999,25 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
@Override
public Object insertSource(Position pos, BigInteger address, final String file, int lineNumber) {
Object sourceElement = null;
- final ISourceLookupDMContext ctx= DMContexts.getAncestorOfType(fTargetContext, ISourceLookupDMContext.class);
- final DsfExecutor executor= getSession().getExecutor();
- Query<Object> query= new Query<Object>() {
+ final ISourceLookupDMContext ctx = DMContexts.getAncestorOfType(fTargetContext, ISourceLookupDMContext.class);
+ final DsfExecutor executor = getSession().getExecutor();
+ Query<Object> query = new Query<Object>() {
@Override
protected void execute(final DataRequestMonitor<Object> rm) {
- final DataRequestMonitor<Object> request= new DataRequestMonitor<Object>(executor, rm) {
+ final DataRequestMonitor<Object> request = new DataRequestMonitor<Object>(executor, rm) {
@Override
protected void handleSuccess() {
rm.setData(getData());
rm.done();
}
};
- final ISourceLookup lookup= getService(ISourceLookup.class);
+ final ISourceLookup lookup = getService(ISourceLookup.class);
lookup.getSource(ctx, file, request);
}
};
try {
getSession().getExecutor().execute(query);
- sourceElement= query.get();
+ sourceElement = query.get();
} catch (InterruptedException exc) {
DisassemblyUtils.internalError(exc);
} catch (ExecutionException exc) {
@@ -999,7 +1034,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
if (!hasFrameContext()) {
return;
}
- evaluateAddressExpression(symbol, false, new DataRequestMonitor<BigInteger>(getSession().getExecutor(), null) {
+ evaluateAddressExpression(symbol, false, new DataRequestMonitor<BigInteger>(getSession().getExecutor(), null) {
@Override
protected void handleSuccess() {
final BigInteger address = getData();
@@ -1008,7 +1043,8 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
@Override
public void run() {
fCallback.gotoAddress(address);
- }});
+ }
+ });
}
}
});
@@ -1027,8 +1063,8 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
Query<BigInteger> query = new Query<BigInteger>() {
@Override
protected void execute(DataRequestMonitor<BigInteger> rm) {
- evaluateAddressExpression(symbol, suppressError, rm);
- }
+ evaluateAddressExpression(symbol, suppressError, rm);
+ }
};
getSession().getExecutor().execute(query);
try {
@@ -1037,113 +1073,127 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
return null;
}
}
-
- private void evaluateAddressExpression(final String symbol, final boolean suppressError, final DataRequestMonitor<BigInteger> rm) {
- final IExpressions expressions= getService(IExpressions.class);
+
+ private void evaluateAddressExpression(final String symbol, final boolean suppressError,
+ final DataRequestMonitor<BigInteger> rm) {
+ final IExpressions expressions = getService(IExpressions.class);
if (expressions == null) {
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "", null)); //$NON-NLS-1$
+ rm.setStatus(
+ new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "", null)); //$NON-NLS-1$
rm.done();
return;
}
-
- final IExpressionDMContext exprDmc= expressions.createExpression(fTargetContext, symbol);
+
+ final IExpressionDMContext exprDmc = expressions.createExpression(fTargetContext, symbol);
// first, try to get l-value address
- expressions.getExpressionAddressData(exprDmc, new DataRequestMonitor<IExpressionDMAddress>(getSession().getExecutor(), null) {
- @Override
- protected void handleSuccess() {
- IExpressionDMAddress data = getData();
- final IAddress address = data.getAddress();
- if (address != null && address != IExpressionDMLocation.INVALID_ADDRESS) {
- final BigInteger addressValue = address.getValue();
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.gotoAddress(addressValue);
- }
- });
- rm.setData(addressValue);
- rm.done();
- } else {
- handleError();
- }
- }
- @Override
- protected void handleError() {
- // not an l-value, evaluate expression
- final FormattedValueDMContext valueDmc= expressions.getFormattedValueContext(exprDmc, IFormattedValues.HEX_FORMAT);
- expressions.getFormattedExpressionValue(valueDmc, new DataRequestMonitor<FormattedValueDMData>(getSession().getExecutor(), null) {
+ expressions.getExpressionAddressData(exprDmc,
+ new DataRequestMonitor<IExpressionDMAddress>(getSession().getExecutor(), null) {
@Override
protected void handleSuccess() {
- FormattedValueDMData data= getData();
- String value= data.getFormattedValue();
- BigInteger address= null;
- try {
- address = DisassemblyUtils.decodeAddress(value);
- } catch (final Exception e) {
- // "value" can be empty i.e *fooX, where fooX is a variable.
- // Not sure if this is a bug or not. So, fail the request instead.
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "", null)); //$NON-NLS-1$
-
- if (!suppressError) {
- DisassemblyBackendDsf.this.handleError(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED,
- DisassemblyMessages.Disassembly_log_error_expression_eval + " (" + e.getMessage() + ")", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ IExpressionDMAddress data = getData();
+ final IAddress address = data.getAddress();
+ if (address != null && address != IExpressionDMLocation.INVALID_ADDRESS) {
+ final BigInteger addressValue = address.getValue();
+ fCallback.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ fCallback.gotoAddress(addressValue);
+ }
+ });
+ rm.setData(addressValue);
+ rm.done();
+ } else {
+ handleError();
}
- rm.setData(address);
- rm.done();
}
+
@Override
protected void handleError() {
- if (!suppressError) {
- DisassemblyBackendDsf.this.handleError(getStatus());
- }
- rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "", null)); //$NON-NLS-1$
- rm.done();
+ // not an l-value, evaluate expression
+ final FormattedValueDMContext valueDmc = expressions.getFormattedValueContext(exprDmc,
+ IFormattedValues.HEX_FORMAT);
+ expressions.getFormattedExpressionValue(valueDmc,
+ new DataRequestMonitor<FormattedValueDMData>(getSession().getExecutor(), null) {
+ @Override
+ protected void handleSuccess() {
+ FormattedValueDMData data = getData();
+ String value = data.getFormattedValue();
+ BigInteger address = null;
+ try {
+ address = DisassemblyUtils.decodeAddress(value);
+ } catch (final Exception e) {
+ // "value" can be empty i.e *fooX, where fooX is a variable.
+ // Not sure if this is a bug or not. So, fail the request instead.
+ rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID,
+ IDsfStatusConstants.REQUEST_FAILED, "", null)); //$NON-NLS-1$
+
+ if (!suppressError) {
+ DisassemblyBackendDsf.this.handleError(new Status(IStatus.ERROR,
+ DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED,
+ DisassemblyMessages.Disassembly_log_error_expression_eval + " (" //$NON-NLS-1$
+ + e.getMessage() + ")", //$NON-NLS-1$
+ null));
+ }
+ }
+ rm.setData(address);
+ rm.done();
+ }
+
+ @Override
+ protected void handleError() {
+ if (!suppressError) {
+ DisassemblyBackendDsf.this.handleError(getStatus());
+ }
+ rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID,
+ IDsfStatusConstants.REQUEST_FAILED, "", null)); //$NON-NLS-1$
+ rm.done();
+ }
+ });
}
});
- }
- });
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#retrieveDisassembly(java.lang.String, int, java.math.BigInteger, boolean, boolean, boolean)
*/
@Override
- public void retrieveDisassembly(final String file, final int lines, final BigInteger endAddress, boolean mixed, final boolean showSymbols, final boolean showDisassembly) {
- String debuggerPath= file;
+ public void retrieveDisassembly(final String file, final int lines, final BigInteger endAddress, boolean mixed,
+ final boolean showSymbols, final boolean showDisassembly) {
+ String debuggerPath = file;
// try reverse lookup
- final ISourceLookupDMContext ctx= DMContexts.getAncestorOfType(fTargetContext, ISourceLookupDMContext.class);
- final DsfExecutor executor= getSession().getExecutor();
- Query<String> query= new Query<String>() {
+ final ISourceLookupDMContext ctx = DMContexts.getAncestorOfType(fTargetContext, ISourceLookupDMContext.class);
+ final DsfExecutor executor = getSession().getExecutor();
+ Query<String> query = new Query<String>() {
@Override
protected void execute(final DataRequestMonitor<String> rm) {
- final DataRequestMonitor<String> request= new DataRequestMonitor<String>(executor, rm) {
+ final DataRequestMonitor<String> request = new DataRequestMonitor<String>(executor, rm) {
@Override
protected void handleSuccess() {
rm.setData(getData());
rm.done();
}
};
- final ISourceLookup lookup= getService(ISourceLookup.class);
+ final ISourceLookup lookup = getService(ISourceLookup.class);
lookup.getDebuggerPath(ctx, file, request);
}
};
try {
getSession().getExecutor().execute(query);
- debuggerPath= query.get();
+ debuggerPath = query.get();
} catch (InterruptedException exc) {
internalError(exc);
} catch (ExecutionException exc) {
internalError(exc);
}
- final IDisassemblyDMContext context= DMContexts.getAncestorOfType(fTargetContext, IDisassemblyDMContext.class);
+ final IDisassemblyDMContext context = DMContexts.getAncestorOfType(fTargetContext, IDisassemblyDMContext.class);
- final String finalFile= debuggerPath;
- final DataRequestMonitor<IMixedInstruction[]> disassemblyRequest= new DataRequestMonitor<IMixedInstruction[]>(executor, null) {
+ final String finalFile = debuggerPath;
+ final DataRequestMonitor<IMixedInstruction[]> disassemblyRequest = new DataRequestMonitor<IMixedInstruction[]>(
+ executor, null) {
@Override
public void handleCompleted() {
- final IMixedInstruction[] data= getData();
+ final IMixedInstruction[] data = getData();
if (!isCanceled() && data != null) {
fCallback.asyncExec(new Runnable() {
@Override
@@ -1152,9 +1202,10 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
// retry in non-mixed mode
retrieveDisassembly(file, lines, endAddress, false, showSymbols, showDisassembly);
}
- }});
+ }
+ });
} else {
- final IStatus status= getStatus();
+ final IStatus status = getStatus();
if (status != null && !status.isOK()) {
DisassemblyBackendDsf.this.handleError(getStatus());
}
@@ -1167,14 +1218,15 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
executor.execute(new Runnable() {
@Override
public void run() {
- final IDisassembly disassembly= fServicesTracker.getService(IDisassembly.class);
+ final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
if (disassembly == null) {
disassemblyRequest.cancel();
disassemblyRequest.done();
return;
}
disassembly.getMixedInstructions(context, finalFile, 1, lines, disassemblyRequest);
- }});
+ }
+ });
}
/* (non-Javadoc)
@@ -1185,37 +1237,41 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
if (fTargetFrameContext == null) {
return null;
}
- final DsfExecutor executor= DsfSession.getSession(fDsfSessionId).getExecutor();
- Query<FormattedValueDMData> query= new Query<FormattedValueDMData>() {
+ final DsfExecutor executor = DsfSession.getSession(fDsfSessionId).getExecutor();
+ Query<FormattedValueDMData> query = new Query<FormattedValueDMData>() {
@Override
protected void execute(final DataRequestMonitor<FormattedValueDMData> rm) {
- IExecutionDMContext exeCtx = DMContexts.getAncestorOfType(fTargetFrameContext, IExecutionDMContext.class);
- final IRunControl rc= getService(IRunControl.class);
+ IExecutionDMContext exeCtx = DMContexts.getAncestorOfType(fTargetFrameContext,
+ IExecutionDMContext.class);
+ final IRunControl rc = getService(IRunControl.class);
if (rc == null || !rc.isSuspended(exeCtx)) {
rm.done();
return;
}
- final IExpressions expressions= getService(IExpressions.class);
+ final IExpressions expressions = getService(IExpressions.class);
if (expressions == null) {
rm.done();
return;
}
- IExpressionDMContext exprDmc= expressions.createExpression(fTargetFrameContext, expression);
- final FormattedValueDMContext valueDmc= expressions.getFormattedValueContext(exprDmc, IFormattedValues.NATURAL_FORMAT);
- expressions.getFormattedExpressionValue(valueDmc, new DataRequestMonitor<FormattedValueDMData>(executor, rm) {
- @Override
- protected void handleSuccess() {
- FormattedValueDMData data= getData();
- rm.setData(data);
- rm.done();
- }
- });
- }};
-
+ IExpressionDMContext exprDmc = expressions.createExpression(fTargetFrameContext, expression);
+ final FormattedValueDMContext valueDmc = expressions.getFormattedValueContext(exprDmc,
+ IFormattedValues.NATURAL_FORMAT);
+ expressions.getFormattedExpressionValue(valueDmc,
+ new DataRequestMonitor<FormattedValueDMData>(executor, rm) {
+ @Override
+ protected void handleSuccess() {
+ FormattedValueDMData data = getData();
+ rm.setData(data);
+ rm.done();
+ }
+ });
+ }
+ };
+
executor.execute(query);
- FormattedValueDMData data= null;
+ FormattedValueDMData data = null;
try {
- data= query.get();
+ data = query.get();
} catch (InterruptedException exc) {
} catch (ExecutionException exc) {
}
@@ -1223,9 +1279,9 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
return data.getFormattedValue();
}
return null;
-
+
}
-
+
@Override
public String evaluateRegister(final String potentialRegisterName) {
if (fTargetFrameContext == null) {
@@ -1236,7 +1292,8 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
Query<FormattedValueDMData> query = new Query<FormattedValueDMData>() {
@Override
protected void execute(final DataRequestMonitor<FormattedValueDMData> rm) {
- IExecutionDMContext exeCtx = DMContexts.getAncestorOfType(fTargetFrameContext, IExecutionDMContext.class);
+ IExecutionDMContext exeCtx = DMContexts.getAncestorOfType(fTargetFrameContext,
+ IExecutionDMContext.class);
final IRunControl rc = getService(IRunControl.class);
if (rc == null || !rc.isSuspended(exeCtx)) {
rm.done();
@@ -1247,71 +1304,74 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
rm.done();
return;
}
-
+
// find registers for current frame context
- registersService.findRegister(fTargetFrameContext, potentialRegisterName,
- new DataRequestMonitor<IRegisterDMContext>(executor, rm)
- {
- @Override
- protected void handleSuccess() {
- // handle to the register we're looking-for
- final IRegisterDMContext theOne = getData();
-
- FormattedValueDMContext fmtCtx = registersService.getFormattedValueContext(theOne, IFormattedValues.HEX_FORMAT);
- registersService.getFormattedExpressionValue(fmtCtx, new DataRequestMonitor<FormattedValueDMData>(executor, rm) {
- @Override
- protected void handleSuccess() {
- rm.done(getData());
- }
- });
- }
- });
- }};
-
+ registersService.findRegister(fTargetFrameContext, potentialRegisterName,
+ new DataRequestMonitor<IRegisterDMContext>(executor, rm) {
+ @Override
+ protected void handleSuccess() {
+ // handle to the register we're looking-for
+ final IRegisterDMContext theOne = getData();
+
+ FormattedValueDMContext fmtCtx = registersService.getFormattedValueContext(theOne,
+ IFormattedValues.HEX_FORMAT);
+ registersService.getFormattedExpressionValue(fmtCtx,
+ new DataRequestMonitor<FormattedValueDMData>(executor, rm) {
+ @Override
+ protected void handleSuccess() {
+ rm.done(getData());
+ }
+ });
+ }
+ });
+ }
+ };
+
executor.execute(query);
String returnValue = null;
try {
- // set a query timeout, to help avoid potential deadlock
- FormattedValueDMData data = query.get(500, TimeUnit.MILLISECONDS);
- if (data != null) {
- returnValue = data.getFormattedValue();
- }
+ // set a query timeout, to help avoid potential deadlock
+ FormattedValueDMData data = query.get(500, TimeUnit.MILLISECONDS);
+ if (data != null) {
+ returnValue = data.getFormattedValue();
+ }
} catch (InterruptedException exc) {
} catch (ExecutionException exc) {
} catch (TimeoutException exc) {
- }
+ }
- return returnValue;
+ return returnValue;
}
/**
* Align the opCode of an address.
- *
+ *
* @param addr the address
* @param rm the data request monitor
*/
@ConfinedToDsfExecutor("getSession().getExecutor()")
- void alignOpCodeAddress(final BigInteger addr, final DataRequestMonitor<BigInteger> rm) {
- IDisassembly2 disassembly = getService(IDisassembly2.class);
- if (disassembly == null) {
- rm.setData(addr);
- rm.done();
- return;
- }
-
- final IDisassemblyDMContext context = DMContexts.getAncestorOfType(fTargetContext, IDisassemblyDMContext.class);
- disassembly.alignOpCodeAddress(context, addr, new ImmediateDataRequestMonitor<BigInteger>(rm) {
- @Override
- protected void handleFailure() {
- rm.setData(addr);
- rm.done();
- }
- @Override
- protected void handleSuccess() {
- rm.setData(getData());
- rm.done();
- }
- });
+ void alignOpCodeAddress(final BigInteger addr, final DataRequestMonitor<BigInteger> rm) {
+ IDisassembly2 disassembly = getService(IDisassembly2.class);
+ if (disassembly == null) {
+ rm.setData(addr);
+ rm.done();
+ return;
+ }
+
+ final IDisassemblyDMContext context = DMContexts.getAncestorOfType(fTargetContext, IDisassemblyDMContext.class);
+ disassembly.alignOpCodeAddress(context, addr, new ImmediateDataRequestMonitor<BigInteger>(rm) {
+ @Override
+ protected void handleFailure() {
+ rm.setData(addr);
+ rm.done();
+ }
+
+ @Override
+ protected void handleSuccess() {
+ rm.setData(getData());
+ rm.done();
+ }
+ });
}
/**
@@ -1322,7 +1382,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
protected boolean canDisassembleContext(IDMContext context) {
return DMContexts.getAncestorOfType(context, IExecutionDMContext.class) != null;
}
-
+
/**
* Returns the target context for the current selected debug context.
* @return
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java
index 81fbde9622b..70d71833631 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java
@@ -29,8 +29,9 @@ public class DisassemblyBackendDsfFactory implements IAdapterFactory {
@Override
@SuppressWarnings("unchecked")
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
- if (IDisassemblyBackend.class.equals(adapterType)) {
- if (adaptableObject instanceof IAdaptable && DisassemblyBackendDsf.supportsDebugContext_((IAdaptable)adaptableObject)) {
+ if (IDisassemblyBackend.class.equals(adapterType)) {
+ if (adaptableObject instanceof IAdaptable
+ && DisassemblyBackendDsf.supportsDebugContext_((IAdaptable) adaptableObject)) {
String sessionId = ((IDMVMContext) adaptableObject).getDMContext().getSessionId();
DsfSession session = DsfSession.getSession(sessionId);
if (session.isActive()) {
@@ -41,7 +42,7 @@ public class DisassemblyBackendDsfFactory implements IAdapterFactory {
return adapter;
}
}
- return (T)new DisassemblyBackendDsf();
+ return (T) new DisassemblyBackendDsf();
}
}
return null;
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java
index a7a920938b9..1de8ce769f5 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyColumnSupport.java
@@ -49,9 +49,9 @@ class DisassemblyColumnSupport implements IColumnSupport {
public DisassemblyColumnSupport(DisassemblyPart disassembly, RulerColumnRegistry registry) {
Assert.isLegal(disassembly != null);
Assert.isLegal(registry != null);
- fDisassembly= disassembly;
- fRegistry= registry;
- fColumns= new ArrayList<IContributedRulerColumn>();
+ fDisassembly = disassembly;
+ fRegistry = registry;
+ fColumns = new ArrayList<IContributedRulerColumn>();
}
/*
@@ -61,12 +61,12 @@ class DisassemblyColumnSupport implements IColumnSupport {
public final void setColumnVisible(RulerColumnDescriptor descriptor, boolean visible) {
Assert.isLegal(descriptor != null);
- final CompositeRuler ruler= getRuler();
+ final CompositeRuler ruler = getRuler();
if (ruler == null)
return;
if (!isColumnSupported(descriptor))
- visible= false;
+ visible = false;
if (isColumnVisible(descriptor)) {
if (!visible)
@@ -79,12 +79,12 @@ class DisassemblyColumnSupport implements IColumnSupport {
private void addColumn(final CompositeRuler ruler, final RulerColumnDescriptor descriptor) {
- final int idx= computeIndex(ruler, descriptor);
+ final int idx = computeIndex(ruler, descriptor);
- SafeRunnable runnable= new SafeRunnable() {
+ SafeRunnable runnable = new SafeRunnable() {
@Override
public void run() throws Exception {
- IContributedRulerColumn column= descriptor.createColumn(fDisassembly);
+ IContributedRulerColumn column = descriptor.createColumn(fDisassembly);
fColumns.add(column);
initializeColumn(column);
ruler.addDecorator(idx, column);
@@ -109,7 +109,7 @@ class DisassemblyColumnSupport implements IColumnSupport {
private void removeColumn(final CompositeRuler ruler, final IContributedRulerColumn rulerColumn) {
if (rulerColumn != null) {
- SafeRunnable runnable= new SafeRunnable() {
+ SafeRunnable runnable = new SafeRunnable() {
@Override
public void run() throws Exception {
if (ruler != null)
@@ -130,11 +130,11 @@ class DisassemblyColumnSupport implements IColumnSupport {
* @return the matching column or <code>null</code>
*/
private IContributedRulerColumn getVisibleColumn(CompositeRuler ruler, RulerColumnDescriptor descriptor) {
- for (Iterator<?> it= ruler.getDecoratorIterator(); it.hasNext();) {
- IVerticalRulerColumn column= (IVerticalRulerColumn)it.next();
+ for (Iterator<?> it = ruler.getDecoratorIterator(); it.hasNext();) {
+ IVerticalRulerColumn column = (IVerticalRulerColumn) it.next();
if (column instanceof IContributedRulerColumn) {
- IContributedRulerColumn rulerColumn= (IContributedRulerColumn)column;
- RulerColumnDescriptor rcd= rulerColumn.getDescriptor();
+ IContributedRulerColumn rulerColumn = (IContributedRulerColumn) column;
+ RulerColumnDescriptor rcd = rulerColumn.getDescriptor();
if (descriptor.equals(rcd))
return rulerColumn;
}
@@ -150,13 +150,13 @@ class DisassemblyColumnSupport implements IColumnSupport {
* @return the insertion index for a new column
*/
private int computeIndex(CompositeRuler ruler, RulerColumnDescriptor descriptor) {
- int index= 0;
- List<?> all= fRegistry.getColumnDescriptors();
- int newPos= all.indexOf(descriptor);
- for (Iterator<?> it= ruler.getDecoratorIterator(); it.hasNext();) {
- IVerticalRulerColumn column= (IVerticalRulerColumn) it.next();
+ int index = 0;
+ List<?> all = fRegistry.getColumnDescriptors();
+ int newPos = all.indexOf(descriptor);
+ for (Iterator<?> it = ruler.getDecoratorIterator(); it.hasNext();) {
+ IVerticalRulerColumn column = (IVerticalRulerColumn) it.next();
if (column instanceof IContributedRulerColumn) {
- RulerColumnDescriptor rcd= ((IContributedRulerColumn)column).getDescriptor();
+ RulerColumnDescriptor rcd = ((IContributedRulerColumn) column).getDescriptor();
if (rcd != null && all.indexOf(rcd) > newPos)
break;
}
@@ -168,7 +168,7 @@ class DisassemblyColumnSupport implements IColumnSupport {
@Override
public final boolean isColumnVisible(RulerColumnDescriptor descriptor) {
Assert.isLegal(descriptor != null);
- CompositeRuler ruler= getRuler();
+ CompositeRuler ruler = getRuler();
return ruler != null && getVisibleColumn(ruler, descriptor) != null;
}
@@ -188,7 +188,7 @@ class DisassemblyColumnSupport implements IColumnSupport {
* @return the disassembly part's {@link CompositeRuler} or <code>null</code>
*/
private CompositeRuler getRuler() {
- Object ruler= fDisassembly.getAdapter(IVerticalRulerInfo.class);
+ Object ruler = fDisassembly.getAdapter(IVerticalRulerInfo.class);
if (ruler instanceof CompositeRuler)
return (CompositeRuler) ruler;
return null;
@@ -202,7 +202,8 @@ class DisassemblyColumnSupport implements IColumnSupport {
*/
@Override
public void dispose() {
- for (Iterator<IContributedRulerColumn> iter= new ArrayList<IContributedRulerColumn>(fColumns).iterator(); iter.hasNext();)
+ for (Iterator<IContributedRulerColumn> iter = new ArrayList<IContributedRulerColumn>(fColumns).iterator(); iter
+ .hasNext();)
removeColumn(getRuler(), iter.next());
fColumns.clear();
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyDropAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyDropAdapter.java
index cbeee5b18aa..fa4487cc42e 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyDropAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyDropAdapter.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -21,7 +21,7 @@ import org.eclipse.swt.dnd.*;
public class DisassemblyDropAdapter extends DropTargetAdapter {
private DisassemblyPart fDisassembly;
-
+
/**
* New DisassemblyDropAdapter.
*/
@@ -39,12 +39,12 @@ public class DisassemblyDropAdapter extends DropTargetAdapter {
if (isFileDataType(dataType)) {
// event.data is an array of strings which represent the absolute file pathes
assert event.data instanceof String[];
- String fileNames[] = (String[])event.data;
+ String fileNames[] = (String[]) event.data;
dropFiles(fileNames);
} else if (isTextDataType(dataType)) {
// event.data is a string
assert event.data instanceof String;
- String text = (String)event.data;
+ String text = (String) event.data;
if (text.indexOf('/') != -1 || text.indexOf('.') != -1) {
dropFiles(new String[] { text });
} else {
@@ -74,6 +74,7 @@ public class DisassemblyDropAdapter extends DropTargetAdapter {
private static boolean isFileDataType(TransferData dataType) {
return FileTransfer.getInstance().isSupportedType(dataType);
}
+
private static boolean isTextDataType(TransferData dataType) {
return TextTransfer.getInstance().isSupportedType(dataType);
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java
index e0b174e2b46..433a778835f 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyEditor.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -37,7 +37,7 @@ public class DisassemblyEditor extends DisassemblyPart implements IEditorPart {
private Label fContentDescriptionLabel;
/**
- *
+ *
*/
public DisassemblyEditor() {
super();
@@ -70,7 +70,7 @@ public class DisassemblyEditor extends DisassemblyPart implements IEditorPart {
inner.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
super.createPartControl(inner);
}
-
+
/*
* @see org.eclipse.ui.part.WorkbenchPart#setContentDescription(java.lang.String)
*/
@@ -105,7 +105,7 @@ public class DisassemblyEditor extends DisassemblyPart implements IEditorPart {
*/
@Override
public IEditorSite getEditorSite() {
- return (IEditorSite)getSite();
+ return (IEditorSite) getSite();
}
/*
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyHyperlinkDetector.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyHyperlinkDetector.java
index ba651e4fb1f..a83b61c6359 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyHyperlinkDetector.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyHyperlinkDetector.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -37,8 +37,8 @@ class DisassemblyHyperlinkDetector extends AbstractHyperlinkDetector {
* @param region
*/
public DisassemblyHyperlink(String symbol, IRegion region) {
- fSymbol= symbol;
- fRegion= region;
+ fSymbol = symbol;
+ fRegion = region;
}
/*
@@ -71,7 +71,7 @@ class DisassemblyHyperlinkDetector extends AbstractHyperlinkDetector {
@Override
public void open() {
if (fPart != null) {
- fPart.gotoSymbol(fSymbol);
+ fPart.gotoSymbol(fSymbol);
}
}
@@ -80,16 +80,15 @@ class DisassemblyHyperlinkDetector extends AbstractHyperlinkDetector {
private DisassemblyPart fPart;
public DisassemblyHyperlinkDetector(DisassemblyPart part) {
- fPart= part;
+ fPart = part;
}
/*
* @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion, boolean)
*/
@Override
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer,
- IRegion region, boolean canShowMultipleHyperlinks) {
- IDocument document= textViewer.getDocument();
+ public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
+ IDocument document = textViewer.getDocument();
if (document == null) {
return null;
}
@@ -97,7 +96,7 @@ class DisassemblyHyperlinkDetector extends AbstractHyperlinkDetector {
if (wordRegion != null && wordRegion.getLength() != 0) {
String word;
try {
- word= document.get(wordRegion.getOffset(), wordRegion.getLength());
+ word = document.get(wordRegion.getOffset(), wordRegion.getLength());
return new IHyperlink[] { new DisassemblyHyperlink(word, wordRegion) };
} catch (BadLocationException e) {
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java
index 94d445554f1..04bd4c92cbb 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyImageRegistry.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* Patrick Chuong (Texas Instruments) - Bug fix (326670)
@@ -29,48 +29,57 @@ public class DisassemblyImageRegistry extends AbstractImageRegistry {
private static List<Object[]> fStore = new ArrayList<Object[]>();
private static String add(String plugin, String[] dirs, String name) {
- String key = plugin+'/'+dirs[0]+'/'+name;
- fStore.add(new Object[] {key, plugin, dirs, name});
- return key;
+ String key = plugin + '/' + dirs[0] + '/' + name;
+ fStore.add(new Object[] { key, plugin, dirs, name });
+ return key;
}
- private static final String ORG_ECLIPSE_DEBUG_UI_PLUGIN_ID = "org.eclipse.debug.ui"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_UI_PLUGIN_ID = "org.eclipse.ui"; //$NON-NLS-1$
-
- public static final String ICON_ToggleBreakpoint = add(ORG_ECLIPSE_DEBUG_UI_PLUGIN_ID, new String[] { "full/obj16"}, "brkp_obj.png"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final String ICON_Refresh_enabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] {"full/elcl16"}, "refresh_nav.png"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final String ICON_Refresh_disabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] {"full/dlcl16"}, "refresh_nav.png"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final String ICON_Copy_enabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] {"full/etool16"}, "copy_edit.png"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final String ICON_Copy_disabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] {"full/dtool16"}, "copy_edit.png"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final String ICON_Home_enabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] {"full/elcl16"}, "home_nav.png"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final String ICON_Home_disabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] {"full/dlcl16"}, "home_nav.png"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final String ICON_Sync_enabled = add(ORG_ECLIPSE_DEBUG_UI_PLUGIN_ID, new String[] {"full/elcl16"}, "synced.png"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final String ICON_Sync_disabled = add(ORG_ECLIPSE_DEBUG_UI_PLUGIN_ID, new String[] {"full/dlcl16"}, "synced.png"); //$NON-NLS-1$ //$NON-NLS-2$
+ private static final String ORG_ECLIPSE_DEBUG_UI_PLUGIN_ID = "org.eclipse.debug.ui"; //$NON-NLS-1$
+ private static final String ORG_ECLIPSE_UI_PLUGIN_ID = "org.eclipse.ui"; //$NON-NLS-1$
+
+ public static final String ICON_ToggleBreakpoint = add(ORG_ECLIPSE_DEBUG_UI_PLUGIN_ID,
+ new String[] { "full/obj16" }, "brkp_obj.png"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final String ICON_Refresh_enabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] { "full/elcl16" }, //$NON-NLS-1$
+ "refresh_nav.png"); //$NON-NLS-1$
+ public static final String ICON_Refresh_disabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] { "full/dlcl16" }, //$NON-NLS-1$
+ "refresh_nav.png"); //$NON-NLS-1$
+ public static final String ICON_Copy_enabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] { "full/etool16" }, //$NON-NLS-1$
+ "copy_edit.png"); //$NON-NLS-1$
+ public static final String ICON_Copy_disabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] { "full/dtool16" }, //$NON-NLS-1$
+ "copy_edit.png"); //$NON-NLS-1$
+ public static final String ICON_Home_enabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] { "full/elcl16" }, //$NON-NLS-1$
+ "home_nav.png"); //$NON-NLS-1$
+ public static final String ICON_Home_disabled = add(ORG_ECLIPSE_UI_PLUGIN_ID, new String[] { "full/dlcl16" }, //$NON-NLS-1$
+ "home_nav.png"); //$NON-NLS-1$
+ public static final String ICON_Sync_enabled = add(ORG_ECLIPSE_DEBUG_UI_PLUGIN_ID, new String[] { "full/elcl16" }, //$NON-NLS-1$
+ "synced.png"); //$NON-NLS-1$
+ public static final String ICON_Sync_disabled = add(ORG_ECLIPSE_DEBUG_UI_PLUGIN_ID, new String[] { "full/dlcl16" }, //$NON-NLS-1$
+ "synced.png"); //$NON-NLS-1$
- private static DisassemblyImageRegistry INSTANCE= new DisassemblyImageRegistry(DsfUIPlugin.getDefault());
-
- DisassemblyImageRegistry(Plugin plugin) {
+ private static DisassemblyImageRegistry INSTANCE = new DisassemblyImageRegistry(DsfUIPlugin.getDefault());
+
+ DisassemblyImageRegistry(Plugin plugin) {
super(plugin);
initialize();
}
- void initialize() {
- for (Iterator<Object[]> iter = fStore.iterator(); iter.hasNext();) {
- Object[] element = iter.next();
- if (element.length == 2) {
- String dir= (String) element[0];
- String name= (String) element[1];
- localImage(name, dir, name);
- } else {
- String key = (String) element[0];
- String plugin= (String) element[1];
- String[] dirs= (String[]) element[2];
- String name= (String) element[3];
- externalImage(key, plugin, dirs, name);
- }
- }
+ void initialize() {
+ for (Iterator<Object[]> iter = fStore.iterator(); iter.hasNext();) {
+ Object[] element = iter.next();
+ if (element.length == 2) {
+ String dir = (String) element[0];
+ String name = (String) element[1];
+ localImage(name, dir, name);
+ } else {
+ String key = (String) element[0];
+ String plugin = (String) element[1];
+ String[] dirs = (String[]) element[2];
+ String name = (String) element[3];
+ externalImage(key, plugin, dirs, name);
+ }
+ }
}
-
+
public static ImageDescriptor getImageDescriptor(String key) {
return INSTANCE.getDescriptor(key);
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java
index 8bc7818ae6f..b3a0a09d9d6 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyMessages.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* Patrick Chuong (Texas Instruments) - Bug fix (326670)
@@ -80,12 +80,11 @@ public final class DisassemblyMessages extends NLS {
public static String Disassembly_Error_Dialog_title;
public static String Disassembly_Error_Dialog_ok_button;
public static String DisassemblyBackendDsf_error_UnableToRetrieveData;
- public static String Disassembly_action_AddBreakpoint_label;
- public static String Disassembly_action_AddBreakpoint_errorTitle;
- public static String Disassembly_action_AddBreakpoint_errorMessage;
- public static String Disassembly_action_ToggleBreakpoint_accelerator;
+ public static String Disassembly_action_AddBreakpoint_label;
+ public static String Disassembly_action_AddBreakpoint_errorTitle;
+ public static String Disassembly_action_AddBreakpoint_errorMessage;
+ public static String Disassembly_action_ToggleBreakpoint_accelerator;
-
static {
NLS.initializeMessages(DisassemblyMessages.class.getName(), DisassemblyMessages.class);
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
index f0df59c4da9..2d112f14d3d 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* Patrick Chuong (Texas Instruments) - Bug 326670
@@ -197,15 +197,17 @@ import com.ibm.icu.text.MessageFormat;
* DisassemblyPart
*/
@SuppressWarnings("restriction")
-public abstract class DisassemblyPart extends WorkbenchPart implements IDisassemblyPart, IViewportListener, ITextPresentationListener, IDisassemblyPartCallback {
+public abstract class DisassemblyPart extends WorkbenchPart
+ implements IDisassemblyPart, IViewportListener, ITextPresentationListener, IDisassemblyPartCallback {
- final static boolean DEBUG = Boolean.parseBoolean(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/disassembly")); //$NON-NLS-1$
+ final static boolean DEBUG = Boolean
+ .parseBoolean(Platform.getDebugOption("org.eclipse.cdt.dsf.ui/debug/disassembly")); //$NON-NLS-1$
/**
* Annotation model attachment key for breakpoint annotations.
*/
- private final static String BREAKPOINT_ANNOTATIONS= "breakpoints"; //$NON-NLS-1$
-
+ private final static String BREAKPOINT_ANNOTATIONS = "breakpoints"; //$NON-NLS-1$
+
/**
* Annotation model attachment key for extended PC annotations.
*/
@@ -236,7 +238,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
/**
* A named preference that controls the visible ruler column contributions.
*/
- public static final String PREFERENCE_RULER_CONTRIBUTIONS= "rulerContributions"; //$NON-NLS-1$
+ public static final String PREFERENCE_RULER_CONTRIBUTIONS = "rulerContributions"; //$NON-NLS-1$
protected DisassemblyViewer fViewer;
@@ -254,12 +256,12 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
private MarkerAnnotationPreferences fAnnotationPreferences;
private IPreferenceStore fPreferenceStore;
private IOverviewRuler fOverviewRuler;
- private final ListenerList<IMenuListener> fRulerContextMenuListeners= new ListenerList<>(ListenerList.IDENTITY);
+ private final ListenerList<IMenuListener> fRulerContextMenuListeners = new ListenerList<>(ListenerList.IDENTITY);
private SourceViewerDecorationSupport fDecorationSupport;
private Font fFont;
private IVerticalRuler fVerticalRuler;
private IFindReplaceTarget fFindReplaceTarget;
- private IPropertyChangeListener fPropertyChangeListener= new PropertyChangeListener();
+ private IPropertyChangeListener fPropertyChangeListener = new PropertyChangeListener();
private Color fInstructionColor;
private Color fErrorColor;
private Color fSourceColor;
@@ -275,13 +277,13 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
private BigInteger fStartAddress;
private BigInteger fEndAddress;
- private int fAddressSize= 32;
+ private int fAddressSize = 32;
private volatile boolean fUpdatePending;
- private volatile int fUpdateCount;
+ private volatile int fUpdateCount;
private BigInteger fPCAddress;
- private BigInteger fGotoAddressPending= PC_UNKNOWN;
- private BigInteger fFocusAddress= PC_UNKNOWN;
+ private BigInteger fGotoAddressPending = PC_UNKNOWN;
+ private BigInteger fFocusAddress = PC_UNKNOWN;
private int fBufferZone;
private String fDebugSessionId;
private int fTargetFrame;
@@ -292,7 +294,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
private Position fScrollPos;
private int fScrollLine;
private Position fFocusPos;
- private BigInteger fFrameAddress= PC_UNKNOWN;
+ private BigInteger fFrameAddress = PC_UNKNOWN;
protected Map<String, Action> fGlobalActions = new HashMap<String, Action>();
private List<Action> fSelectionActions = new ArrayList<Action>();
private List<AbstractDisassemblyAction> fStateDependentActions = new ArrayList<AbstractDisassemblyAction>();
@@ -311,44 +313,50 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
private String fPCLastLocationTxt = DisassemblyMessages.Disassembly_GotoLocation_initial_text;
private BigInteger fPCLastAddress = PC_UNKNOWN;
private IAdaptable fDebugContext;
-
+
private String fPCAnnotationColorKey;
private ArrayList<Runnable> fRunnableQueue = new ArrayList<Runnable>();
- protected IPartListener2 fPartListener =
- new IPartListener2() {
- @Override
- public void partActivated(IWorkbenchPartReference partRef) {
- }
- @Override
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- }
- @Override
- public void partClosed(IWorkbenchPartReference partRef) {
- }
- @Override
- public void partDeactivated(IWorkbenchPartReference partRef) {
- }
- @Override
- public void partOpened(IWorkbenchPartReference partRef) {
- }
- @Override
- public void partHidden(IWorkbenchPartReference partRef) {
- if (partRef.getPart(false) == DisassemblyPart.this) {
- setActive(false);
- }
- }
- @Override
- public void partVisible(IWorkbenchPartReference partRef) {
- if (partRef.getPart(false) == DisassemblyPart.this) {
- setActive(true);
- }
+ protected IPartListener2 fPartListener = new IPartListener2() {
+ @Override
+ public void partActivated(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partBroughtToTop(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partClosed(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partDeactivated(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partOpened(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partHidden(IWorkbenchPartReference partRef) {
+ if (partRef.getPart(false) == DisassemblyPart.this) {
+ setActive(false);
}
- @Override
- public void partInputChanged(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partVisible(IWorkbenchPartReference partRef) {
+ if (partRef.getPart(false) == DisassemblyPart.this) {
+ setActive(true);
}
- };
+ }
+
+ @Override
+ public void partInputChanged(IWorkbenchPartReference partRef) {
+ }
+ };
private boolean fActive = true;
private boolean fDoPendingPosted;
@@ -362,66 +370,73 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
private ArrayList<IHandlerActivation> fHandlerActivations;
private IContextActivation fContextActivation;
-
+
private IDisassemblyBackend fBackend;
-
+
private AddressBarContributionItem fAddressBar = null;
private Action fJumpToAddressAction = new JumpToAddressAction(this);
- private IDebugContextListener fDebugContextListener;
- private DisassemblyAnnotationModel fExtPCAnnotationModel;
+ private IDebugContextListener fDebugContextListener;
+ private DisassemblyAnnotationModel fExtPCAnnotationModel;
private IColumnSupport fColumnSupport;
- private final class SyncActiveDebugContextAction extends Action {
- public SyncActiveDebugContextAction() {
- setChecked(DisassemblyPart.this.isSyncWithActiveDebugContext());
- setText(DisassemblyMessages.Disassembly_action_Sync_label);
- setImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Sync_enabled));
- setDisabledImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Sync_disabled));
- }
-
- @Override
- public void run() {
- DisassemblyPart.this.setSyncWithDebugView(this.isChecked());
- }
- }
-
- private final class TrackExpressionAction extends Action {
- public TrackExpressionAction() {
- setChecked(DisassemblyPart.this.isTrackExpression());
- setEnabled(!fSynchWithActiveDebugContext);
- setText(DisassemblyMessages.Disassembly_action_TrackExpression_label);
- }
-
- @Override
- public void run() {
- DisassemblyPart.this.setTrackExpression(this.isChecked());
- }
-
- }
-
- private final class ActionRefreshView extends AbstractDisassemblyAction {
+ private final class SyncActiveDebugContextAction extends Action {
+ public SyncActiveDebugContextAction() {
+ setChecked(DisassemblyPart.this.isSyncWithActiveDebugContext());
+ setText(DisassemblyMessages.Disassembly_action_Sync_label);
+ setImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Sync_enabled));
+ setDisabledImageDescriptor(
+ DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Sync_disabled));
+ }
+
+ @Override
+ public void run() {
+ DisassemblyPart.this.setSyncWithDebugView(this.isChecked());
+ }
+ }
+
+ private final class TrackExpressionAction extends Action {
+ public TrackExpressionAction() {
+ setChecked(DisassemblyPart.this.isTrackExpression());
+ setEnabled(!fSynchWithActiveDebugContext);
+ setText(DisassemblyMessages.Disassembly_action_TrackExpression_label);
+ }
+
+ @Override
+ public void run() {
+ DisassemblyPart.this.setTrackExpression(this.isChecked());
+ }
+
+ }
+
+ private final class ActionRefreshView extends AbstractDisassemblyAction {
public ActionRefreshView() {
super(DisassemblyPart.this);
setText(DisassemblyMessages.Disassembly_action_RefreshView_label);
- setImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Refresh_enabled));
- setDisabledImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Refresh_disabled));
+ setImageDescriptor(
+ DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Refresh_enabled));
+ setDisabledImageDescriptor(
+ DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Refresh_disabled));
}
+
@Override
public void run() {
fPCLastAddress = getTopAddress();
refreshView(10);
}
}
-
+
private final class ActionToggleBreakpointEnablement extends AbstractDisassemblyAction {
private IBreakpoint fBreakpoint;
+
public ActionToggleBreakpointEnablement() {
super(DisassemblyPart.this);
- setText(DisassemblyMessages.Disassembly_action_EnableBreakpoint_label + "\t" + //$NON-NLS-1$
- CDebugUIUtils.formatKeyBindingString(SWT.MOD2, DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
+ setText(DisassemblyMessages.Disassembly_action_EnableBreakpoint_label + "\t" + //$NON-NLS-1$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD2,
+ DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
}
+
@Override
public void run() {
try {
@@ -430,6 +445,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
internalError(e);
}
}
+
@Override
public void update() {
super.update();
@@ -442,11 +458,13 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fBreakpoint = bps[0];
try {
if (fBreakpoint.isEnabled()) {
- setText(DisassemblyMessages.Disassembly_action_DisableBreakpoint_label + "\t" + //$NON-NLS-1$
- CDebugUIUtils.formatKeyBindingString(SWT.MOD2, DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
+ setText(DisassemblyMessages.Disassembly_action_DisableBreakpoint_label + "\t" + //$NON-NLS-1$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD2,
+ DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
} else {
- setText(DisassemblyMessages.Disassembly_action_EnableBreakpoint_label + "\t" + //$NON-NLS-1$
- CDebugUIUtils.formatKeyBindingString(SWT.MOD2, DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
+ setText(DisassemblyMessages.Disassembly_action_EnableBreakpoint_label + "\t" + //$NON-NLS-1$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD2,
+ DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
}
} catch (CoreException e) {
setEnabled(false);
@@ -461,11 +479,13 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
super(DisassemblyPart.this, IAction.AS_CHECK_BOX);
setText(DisassemblyMessages.Disassembly_action_ShowSource_label);
}
+
@Override
public void run() {
IPreferenceStore store = DsfUIPlugin.getDefault().getPreferenceStore();
store.setValue(DisassemblyPreferenceConstants.SHOW_SOURCE, !fShowSource);
}
+
@Override
public void update() {
super.update();
@@ -481,11 +501,13 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
super(DisassemblyPart.this, IAction.AS_CHECK_BOX);
setText(DisassemblyMessages.Disassembly_action_ShowSymbols_label);
}
+
@Override
public void run() {
IPreferenceStore store = DsfUIPlugin.getDefault().getPreferenceStore();
store.setValue(DisassemblyPreferenceConstants.SHOW_SYMBOLS, !fShowSymbols);
}
+
@Override
public void update() {
super.update();
@@ -507,23 +529,22 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
}
-
/**
* The constructor.
*/
public DisassemblyPart() {
fAnnotationPreferences = new MarkerAnnotationPreferences();
setPreferenceStore(new ChainedPreferenceStore(new IPreferenceStore[] {
- DsfUIPlugin.getDefault().getPreferenceStore(), EditorsUI.getPreferenceStore() }));
+ DsfUIPlugin.getDefault().getPreferenceStore(), EditorsUI.getPreferenceStore() }));
fPCAddress = fFrameAddress = PC_UNKNOWN;
fTargetFrame = -1;
fBufferZone = 32;
fPCAnnotation = new DisassemblyIPAnnotation(true, 0);
fSecondaryPCAnnotation = new DisassemblyIPAnnotation(false, 0);
- IPreferenceStore prefs = getPreferenceStore();
+ IPreferenceStore prefs = getPreferenceStore();
fStartAddress = new BigInteger(prefs.getString(DisassemblyPreferenceConstants.START_ADDRESS));
String endAddressString = prefs.getString(DisassemblyPreferenceConstants.END_ADDRESS);
- if(endAddressString.startsWith("0x")) //$NON-NLS-1$
+ if (endAddressString.startsWith("0x")) //$NON-NLS-1$
fEndAddress = new BigInteger(endAddressString.substring(2), 16);
else
fEndAddress = new BigInteger(endAddressString, 16);
@@ -540,34 +561,35 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
/*
* @see IAdaptable#getAdapter(java.lang.Class)
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
@Override
public <T> T getAdapter(Class<T> required) {
if (IVerticalRulerInfo.class.equals(required)) {
if (fVerticalRuler != null) {
- return (T)fVerticalRuler;
+ return (T) fVerticalRuler;
}
} else if (IDisassemblyPart.class.equals(required)) {
- return (T)this;
+ return (T) this;
} else if (IFindReplaceTarget.class.equals(required)) {
if (fFindReplaceTarget == null) {
fFindReplaceTarget = (fViewer == null ? null : fViewer.getFindReplaceTarget());
}
- return (T)fFindReplaceTarget;
+ return (T) fFindReplaceTarget;
} else if (ITextOperationTarget.class.equals(required)) {
- return (fViewer == null ? null : (T)fViewer.getTextOperationTarget());
+ return (fViewer == null ? null : (T) fViewer.getTextOperationTarget());
} else if (Control.class.equals(required)) {
- return fViewer != null ? (T)fViewer.getTextWidget() : null;
+ return fViewer != null ? (T) fViewer.getTextWidget() : null;
} else if (IGotoMarker.class.equals(required)) {
- return (T)new IGotoMarker() {
+ return (T) new IGotoMarker() {
@Override
public void gotoMarker(IMarker marker) {
DisassemblyPart.this.gotoMarker(marker);
- }};
+ }
+ };
} else if (IColumnSupport.class.equals(required)) {
if (fColumnSupport == null)
- fColumnSupport= createColumnSupport();
- return (T)fColumnSupport;
+ fColumnSupport = createColumnSupport();
+ return (T) fColumnSupport;
}
return super.getAdapter(required);
@@ -580,15 +602,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
*/
private void addRulerContributionActions(IMenuManager menu) {
// store directly in generic editor preferences
- final IColumnSupport support= getAdapter(IColumnSupport.class);
- IPreferenceStore store= DsfUIPlugin.getDefault().getPreferenceStore();
- final RulerColumnPreferenceAdapter adapter= new RulerColumnPreferenceAdapter(store, PREFERENCE_RULER_CONTRIBUTIONS);
- List<RulerColumnDescriptor> descriptors= RulerColumnRegistry.getDefault().getColumnDescriptors();
+ final IColumnSupport support = getAdapter(IColumnSupport.class);
+ IPreferenceStore store = DsfUIPlugin.getDefault().getPreferenceStore();
+ final RulerColumnPreferenceAdapter adapter = new RulerColumnPreferenceAdapter(store,
+ PREFERENCE_RULER_CONTRIBUTIONS);
+ List<RulerColumnDescriptor> descriptors = RulerColumnRegistry.getDefault().getColumnDescriptors();
for (final RulerColumnDescriptor descriptor : descriptors) {
if (!descriptor.isIncludedInMenu() || !support.isColumnSupported(descriptor))
continue;
- final boolean isVisible= support.isColumnVisible(descriptor);
- IAction action= new Action(MessageFormat.format(DisassemblyMessages.DisassemblyPart_showRulerColumn_label, new Object[] {descriptor.getName()}), IAction.AS_CHECK_BOX) {
+ final boolean isVisible = support.isColumnVisible(descriptor);
+ IAction action = new Action(MessageFormat.format(DisassemblyMessages.DisassemblyPart_showRulerColumn_label,
+ new Object[] { descriptor.getName() }), IAction.AS_CHECK_BOX) {
@Override
public void run() {
if (descriptor.isGlobal())
@@ -611,16 +635,16 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
* @param ruler the composite ruler to add contributions to
*/
protected void updateContributedRulerColumns(CompositeRuler ruler) {
- IColumnSupport support= getAdapter(IColumnSupport.class);
+ IColumnSupport support = getAdapter(IColumnSupport.class);
if (support == null)
return;
- RulerColumnPreferenceAdapter adapter= null;
+ RulerColumnPreferenceAdapter adapter = null;
if (fPreferenceStore != null)
- adapter= new RulerColumnPreferenceAdapter(getPreferenceStore(), PREFERENCE_RULER_CONTRIBUTIONS);
+ adapter = new RulerColumnPreferenceAdapter(getPreferenceStore(), PREFERENCE_RULER_CONTRIBUTIONS);
- RulerColumnRegistry registry= RulerColumnRegistry.getDefault();
- List<RulerColumnDescriptor> descriptors= registry.getColumnDescriptors();
+ RulerColumnRegistry registry = RulerColumnRegistry.getDefault();
+ List<RulerColumnDescriptor> descriptors = registry.getColumnDescriptors();
for (RulerColumnDescriptor descriptor : descriptors) {
support.setColumnVisible(descriptor, adapter == null || adapter.isEnabled(descriptor));
}
@@ -629,7 +653,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
protected IColumnSupport createColumnSupport() {
return new DisassemblyColumnSupport(this, RulerColumnRegistry.getDefault());
}
-
+
private void setPreferenceStore(IPreferenceStore store) {
if (fPreferenceStore != null) {
fPreferenceStore.removePropertyChangeListener(fPropertyChangeListener);
@@ -684,19 +708,20 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
} else if (property.equals(fPCAnnotationColorKey)) {
fPCAnnotationRGB = PreferenceConverter.getColor(store, fPCAnnotationColorKey);
// redraw
- for (Iterator<AddressRangePosition> it=fPCHistory.iterator(); it.hasNext();) {
+ for (Iterator<AddressRangePosition> it = fPCHistory.iterator(); it.hasNext();) {
AddressRangePosition pos = it.next();
fViewer.invalidateTextPresentation(pos.offset, pos.length);
}
} else if (property.equals(DisassemblyPreferenceConstants.PC_HISTORY_SIZE)) {
fPCHistorySizeMax = store.getInt(property);
} else if (PREFERENCE_RULER_CONTRIBUTIONS.equals(property)) {
- String[] difference= StringSetSerializer.getDifference((String) event.getOldValue(), (String) event.getNewValue());
- IColumnSupport support= getAdapter(IColumnSupport.class);
- for (int i= 0; i < difference.length; i++) {
- RulerColumnDescriptor desc= RulerColumnRegistry.getDefault().getColumnDescriptor(difference[i]);
- if (desc != null && support.isColumnSupported(desc)) {
- boolean newState= !support.isColumnVisible(desc);
+ String[] difference = StringSetSerializer.getDifference((String) event.getOldValue(),
+ (String) event.getNewValue());
+ IColumnSupport support = getAdapter(IColumnSupport.class);
+ for (int i = 0; i < difference.length; i++) {
+ RulerColumnDescriptor desc = RulerColumnRegistry.getDefault().getColumnDescriptor(difference[i]);
+ if (desc != null && support.isColumnSupported(desc)) {
+ boolean newState = !support.isColumnVisible(desc);
support.setColumnVisible(desc, newState);
}
}
@@ -721,7 +746,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fViewer.addTextPresentationListener(this);
fViewer.configure(sourceViewerConfig);
fDecorationSupport = new SourceViewerDecorationSupport(fViewer, getOverviewRuler(), getAnnotationAccess(),
- getSharedColors());
+ getSharedColors());
configureSourceViewerDecorationSupport(fDecorationSupport);
fDecorationSupport.install(getPreferenceStore());
if (fPCAnnotationColorKey != null) {
@@ -739,7 +764,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
hookRulerContextMenu();
hookContextMenu();
contributeToActionBars();
-
+
fViewer.getTextWidget().addVerifyKeyListener(new VerifyKeyListener() {
@Override
public void verifyKey(VerifyEvent event) {
@@ -765,16 +790,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fSourceColor = getSharedColors().getColor(new RGB(64, 0, 80));
fLabelColor = getSharedColors().getColor(new RGB(0, 0, 96));
- IVerticalRuler ruler= getVerticalRuler();
+ IVerticalRuler ruler = getVerticalRuler();
if (ruler instanceof CompositeRuler) {
updateContributedRulerColumns((CompositeRuler) ruler);
}
initDragAndDrop();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fViewer.getControl(), IDisassemblyHelpContextIds.DISASSEMBLY_VIEW);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(fViewer.getControl(),
+ IDisassemblyHelpContextIds.DISASSEMBLY_VIEW);
updateTitle();
updateStateDependentActions();
-
+
if (fDebugSessionId != null) {
debugContextChanged();
} else {
@@ -788,16 +814,16 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
@Override
protected void setSite(IWorkbenchPartSite site) {
super.setSite(site);
- site.getPage().addPartListener(fPartListener);
- fDebugContextListener = new IDebugContextListener() {
- @Override
+ site.getPage().addPartListener(fPartListener);
+ fDebugContextListener = new IDebugContextListener() {
+ @Override
public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
- updateDebugContext();
- }
- }
- };
- DebugUITools.addPartDebugContextListener(site, fDebugContextListener);
+ if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
+ updateDebugContext();
+ }
+ }
+ };
+ DebugUITools.addPartDebugContextListener(site, fDebugContextListener);
}
private DisassemblyDocument createDocument() {
@@ -814,25 +840,25 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
IWorkbenchPartSite site = getSite();
site.setSelectionProvider(null);
site.getPage().removePartListener(fPartListener);
- if (fDebugContextListener != null) {
- DebugUITools.removePartDebugContextListener(site, fDebugContextListener);
- fDebugContextListener = null;
- }
+ if (fDebugContextListener != null) {
+ DebugUITools.removePartDebugContextListener(site, fDebugContextListener);
+ fDebugContextListener = null;
+ }
if (fHandlerActivations != null) {
IHandlerService handlerService = site.getService(IHandlerService.class);
handlerService.deactivateHandlers(fHandlerActivations);
fHandlerActivations = null;
}
-
+
deactivateDisassemblyContext();
-
+
fViewer = null;
if (fBackend != null) {
fBackend.clearDebugContext();
fBackend.dispose();
fBackend = null;
}
-
+
fAnnotationAccess = null;
fAnnotationPreferences = null;
fAnnotationRulerColumn = null;
@@ -860,7 +886,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
if (fColumnSupport != null) {
fColumnSupport.dispose();
- fColumnSupport= null;
+ fColumnSupport = null;
}
fDocument.dispose();
@@ -896,7 +922,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
Iterator<?> e = fAnnotationPreferences.getAnnotationPreferences().iterator();
while (e.hasNext()) {
- AnnotationPreference pref = (AnnotationPreference)e.next();
+ AnnotationPreference pref = (AnnotationPreference) e.next();
support.setAnnotationPreference(pref);
if (pref.getAnnotationType().equals(fPCAnnotation.getType())) {
fPCAnnotationColorKey = pref.getColorPreferenceKey();
@@ -945,7 +971,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
else if (fPreferenceStore != null) {
// Backward compatibility
if (fPreferenceStore.contains(JFaceResources.TEXT_FONT)
- && !fPreferenceStore.isDefault(JFaceResources.TEXT_FONT)) {
+ && !fPreferenceStore.isDefault(JFaceResources.TEXT_FONT)) {
FontData data = PreferenceConverter.getFontData(fPreferenceStore, JFaceResources.TEXT_FONT);
if (data != null) {
@@ -1029,7 +1055,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
IVerticalRulerColumn column = (IVerticalRulerColumn) iter.next();
if (column instanceof AnnotationRulerColumn) {
fAnnotationRulerColumn = (AnnotationRulerColumn) column;
- for (Iterator<?> iter2 = fAnnotationPreferences.getAnnotationPreferences().iterator(); iter2.hasNext();) {
+ for (Iterator<?> iter2 = fAnnotationPreferences.getAnnotationPreferences().iterator(); iter2
+ .hasNext();) {
AnnotationPreference preference = (AnnotationPreference) iter2.next();
String key = preference.getVerticalRulerPreferenceKey();
boolean showAnnotation = true;
@@ -1087,29 +1114,28 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
* @param rulerColumn the ruler column to be initialized
*/
protected void initializeRulerColumn(DisassemblyRulerColumn rulerColumn, String colorPrefKey) {
- ISharedTextColors sharedColors= getSharedColors();
- IPreferenceStore store= getPreferenceStore();
+ ISharedTextColors sharedColors = getSharedColors();
+ IPreferenceStore store = getPreferenceStore();
if (store != null) {
- RGB rgb= null;
+ RGB rgb = null;
// foreground color
if (store.contains(colorPrefKey)) {
if (store.isDefault(colorPrefKey))
- rgb= PreferenceConverter.getDefaultColor(store, colorPrefKey);
+ rgb = PreferenceConverter.getDefaultColor(store, colorPrefKey);
else
- rgb= PreferenceConverter.getColor(store, colorPrefKey);
+ rgb = PreferenceConverter.getColor(store, colorPrefKey);
}
if (rgb == null)
- rgb= new RGB(0, 0, 0);
+ rgb = new RGB(0, 0, 0);
rulerColumn.setForeground(sharedColors.getColor(rgb));
- rgb= null;
+ rgb = null;
rulerColumn.redraw();
}
}
-
/**
* @return the preference store
*/
@@ -1195,7 +1221,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
bars.setGlobalActionHandler(key, action);
}
IMenuManager menu = bars.getMenuManager();
- IMenuManager navigateMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
+ IMenuManager navigateMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
if (navigateMenu != null) {
navigateMenu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fActionGotoPC);
navigateMenu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fActionGotoAddress);
@@ -1212,8 +1238,10 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
manager.add(new Separator("group.breakpoints")); //$NON-NLS-1$
manager.add(new Separator("group.debug")); //$NON-NLS-1$
manager.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
- manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, fGlobalActions.get(ITextEditorActionConstants.COPY));
- manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL));
+ manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
+ fGlobalActions.get(ITextEditorActionConstants.COPY));
+ manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
+ fGlobalActions.get(ITextEditorActionConstants.SELECT_ALL));
manager.add(new Separator(ITextEditorActionConstants.GROUP_SETTINGS));
manager.add(fActionToggleSource);
manager.add(fActionToggleSymbols);
@@ -1241,36 +1269,39 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
listener.menuAboutToShow(manager);
manager.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
- manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, fGlobalActions.get(ITextEditorActionConstants.COPY));
+ manager.appendToGroup(ITextEditorActionConstants.GROUP_EDIT,
+ fGlobalActions.get(ITextEditorActionConstants.COPY));
}
protected void fillLocalToolBar(IToolBarManager manager) {
final int ADDRESS_BAR_WIDTH = 190;
- ToolBar toolbar = ((ToolBarManager)manager).getControl();
+ ToolBar toolbar = ((ToolBarManager) manager).getControl();
fAddressBar = new AddressBarContributionItem(fJumpToAddressAction);
- fAddressBar.createAddressBox(toolbar, ADDRESS_BAR_WIDTH, DisassemblyMessages.Disassembly_GotoLocation_initial_text, DisassemblyMessages.Disassembly_GotoLocation_warning);
+ fAddressBar.createAddressBox(toolbar, ADDRESS_BAR_WIDTH,
+ DisassemblyMessages.Disassembly_GotoLocation_initial_text,
+ DisassemblyMessages.Disassembly_GotoLocation_warning);
manager.add(fAddressBar);
- fJumpToAddressAction.setEnabled(fDebugSessionId!=null);
-
+ fJumpToAddressAction.setEnabled(fDebugSessionId != null);
+
manager.add(new Separator());
manager.add(fActionRefreshView);
manager.add(fActionGotoPC);
manager.add(fSyncAction);
manager.add(fActionToggleSource);
- // Other plug-ins can contribute their actions here
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ // Other plug-ins can contribute their actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
protected void updateSelectionDependentActions() {
- Iterator<Action> iterator= fSelectionActions.iterator();
+ Iterator<Action> iterator = fSelectionActions.iterator();
while (iterator.hasNext()) {
- IUpdate action = (IUpdate)iterator.next();
+ IUpdate action = (IUpdate) iterator.next();
action.update();
}
}
protected void updateStateDependentActions() {
- Iterator<AbstractDisassemblyAction> iterator= fStateDependentActions.iterator();
+ Iterator<AbstractDisassemblyAction> iterator = fStateDependentActions.iterator();
while (iterator.hasNext()) {
IUpdate action = iterator.next();
action.update();
@@ -1279,35 +1310,39 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
protected void createActions() {
Action action;
- action= new TextOperationAction(fViewer, ITextOperationTarget.COPY);
+ action = new TextOperationAction(fViewer, ITextOperationTarget.COPY);
action.setText(DisassemblyMessages.Disassembly_action_Copy_label);
- action.setImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Copy_enabled));
- action.setDisabledImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Copy_disabled));
+ action.setImageDescriptor(
+ DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Copy_enabled));
+ action.setDisabledImageDescriptor(
+ DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Copy_disabled));
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);
fGlobalActions.put(ITextEditorActionConstants.COPY, action);
fSelectionActions.add(action);
- action= new TextOperationAction(fViewer, ITextOperationTarget.SELECT_ALL);
+ action = new TextOperationAction(fViewer, ITextOperationTarget.SELECT_ALL);
action.setText(DisassemblyMessages.Disassembly_action_SelectAll_label);
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_SELECT_ALL);
fGlobalActions.put(ITextEditorActionConstants.SELECT_ALL, action);
- action= new TextOperationAction(fViewer, ITextOperationTarget.PRINT);
+ action = new TextOperationAction(fViewer, ITextOperationTarget.PRINT);
action.setActionDefinitionId(IWorkbenchCommandConstants.FILE_PRINT);
fGlobalActions.put(ITextEditorActionConstants.PRINT, action);
- action= new FindReplaceAction(DisassemblyMessages.getBundleForConstructedKeys(), "FindReplaceAction.", this); //$NON-NLS-1$
+ action = new FindReplaceAction(DisassemblyMessages.getBundleForConstructedKeys(), "FindReplaceAction.", this); //$NON-NLS-1$
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
fGlobalActions.put(ActionFactory.FIND.getId(), action);
fSelectionActions.add(action);
fActionGotoPC = new ActionGotoProgramCounter(this);
fActionGotoPC.setActionDefinitionId(COMMAND_ID_GOTO_PC);
- fActionGotoPC.setImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Home_enabled));
- fActionGotoPC.setDisabledImageDescriptor(DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Home_disabled));
+ fActionGotoPC.setImageDescriptor(
+ DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Home_enabled));
+ fActionGotoPC.setDisabledImageDescriptor(
+ DisassemblyImageRegistry.getImageDescriptor(DisassemblyImageRegistry.ICON_Home_disabled));
fStateDependentActions.add(fActionGotoPC);
registerWithHandlerService(fActionGotoPC);
-
+
fActionGotoAddress = new ActionGotoAddress(this);
fActionGotoAddress.setActionDefinitionId(COMMAND_ID_GOTO_ADDRESS);
fStateDependentActions.add(fActionGotoAddress);
@@ -1315,7 +1350,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fActionToggleSource = new ActionToggleSource();
fStateDependentActions.add(fActionToggleSource);
- fActionToggleSource.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(DsfUIPlugin.PLUGIN_ID, "icons/source.gif")); //$NON-NLS-1$
+ fActionToggleSource.setImageDescriptor(
+ AbstractUIPlugin.imageDescriptorFromPlugin(DsfUIPlugin.PLUGIN_ID, "icons/source.gif")); //$NON-NLS-1$
fVerticalRuler.getControl().addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(final MouseEvent e) {
@@ -1323,17 +1359,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
IHandlerService handlerService = getSite().getService(IHandlerService.class);
if (handlerService != null) {
try {
- Event event= new Event();
- event.display = e.display;
- event.widget = e.widget;
- event.time = e.time;
- event.data = e.data;
- event.x = e.x;
- event.y = e.y;
- event.button = e.button;
- event.stateMask = e.stateMask;
- event.count = e.count;
-
+ Event event = new Event();
+ event.display = e.display;
+ event.widget = e.widget;
+ event.time = e.time;
+ event.data = e.data;
+ event.x = e.x;
+ event.y = e.y;
+ event.button = e.button;
+ event.stateMask = e.stateMask;
+ event.count = e.count;
+
handlerService.executeCommand(COMMAND_ID_TOGGLE_BREAKPOINT, event);
} catch (org.eclipse.core.commands.ExecutionException exc) {
DsfUIPlugin.log(exc);
@@ -1356,7 +1392,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
/**
* Register given action with the handler service for key bindings.
- *
+ *
* @param action
*/
private void registerWithHandlerService(IAction action) {
@@ -1364,7 +1400,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fHandlerActivations = new ArrayList<IHandlerActivation>(5);
}
IHandlerService handlerService = getSite().getService(IHandlerService.class);
- fHandlerActivations.add(handlerService.activateHandler(action.getActionDefinitionId(), new ActionHandler(action)));
+ fHandlerActivations
+ .add(handlerService.activateHandler(action.getActionDefinitionId(), new ActionHandler(action)));
}
/*
@@ -1396,17 +1433,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
});
}
}
-
+
public final void gotoLocationByUser(BigInteger address, String locationTxt) {
fPCLastAddress = address;
fPCLastLocationTxt = locationTxt;
gotoAddress(address);
}
-
+
public final void gotoActiveFrameByUser() {
gotoFrame(getActiveStackFrame());
}
-
+
/*
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#gotoAddress(java.math.BigInteger)
*/
@@ -1415,7 +1452,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (fDebugSessionId == null) {
return;
}
- if (DEBUG) System.out.println("gotoAddress " + getAddressText(address)); //$NON-NLS-1$
+ if (DEBUG)
+ System.out.println("gotoAddress " + getAddressText(address)); //$NON-NLS-1$
fFocusAddress = address;
BigInteger previousAddress = fGotoAddressPending;
if (fGotoAddressPending == PC_UNKNOWN) {
@@ -1427,21 +1465,22 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
AddressRangePosition pos = getPositionOfAddress(address);
if (pos != null) {
if (pos.fValid) {
- if ((pos instanceof ErrorPosition || !pos.fAddressOffset.equals(address)) && !previousAddress.equals(address)) {
- // address is within a disassembled instruction or error - need to invalidate
- pos.fValid = false;
- fDocument.addInvalidAddressRange(pos);
- } else {
- if (fGotoAddressPending.equals(address)) {
- fGotoAddressPending = PC_UNKNOWN;
- }
- gotoPosition(pos, !address.equals(fFrameAddress));
- return;
- }
- }
- int lines = fBufferZone+3;
- BigInteger endAddress = pos.fAddressOffset.add(pos.fAddressLength).min(
- address.add(BigInteger.valueOf(lines * fDocument.getMeanSizeOfInstructions())));
+ if ((pos instanceof ErrorPosition || !pos.fAddressOffset.equals(address))
+ && !previousAddress.equals(address)) {
+ // address is within a disassembled instruction or error - need to invalidate
+ pos.fValid = false;
+ fDocument.addInvalidAddressRange(pos);
+ } else {
+ if (fGotoAddressPending.equals(address)) {
+ fGotoAddressPending = PC_UNKNOWN;
+ }
+ gotoPosition(pos, !address.equals(fFrameAddress));
+ return;
+ }
+ }
+ int lines = fBufferZone + 3;
+ BigInteger endAddress = pos.fAddressOffset.add(pos.fAddressLength)
+ .min(address.add(BigInteger.valueOf(lines * fDocument.getMeanSizeOfInstructions())));
retrieveDisassembly(address, endAddress, lines);
}
}
@@ -1498,28 +1537,28 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
*/
@Override
public void viewportChanged(int verticalOffset) {
- if (fDebugSessionId != null && fGotoAddressPending == PC_UNKNOWN && fScrollPos == null && !fUpdatePending && !fRefreshViewPending
- && fFocusAddress != PC_UNKNOWN) {
+ if (fDebugSessionId != null && fGotoAddressPending == PC_UNKNOWN && fScrollPos == null && !fUpdatePending
+ && !fRefreshViewPending && fFocusAddress != PC_UNKNOWN) {
fUpdatePending = true;
- final int updateCount = fUpdateCount;
- invokeLater(new Runnable() {
- @Override
+ final int updateCount = fUpdateCount;
+ invokeLater(new Runnable() {
+ @Override
public void run() {
- if (updateCount == fUpdateCount) {
- assert fUpdatePending;
- if (fUpdatePending) {
- fUpdatePending = false;
- updateVisibleArea();
- }
- }
- }
- });
+ if (updateCount == fUpdateCount) {
+ assert fUpdatePending;
+ if (fUpdatePending) {
+ fUpdatePending = false;
+ updateVisibleArea();
+ }
+ }
+ }
+ });
}
}
/**
* Update lines of currently visible area + one page buffer zone below.
- *
+ *
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#updateVisibleArea()
*/
@Override
@@ -1539,7 +1578,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
int bottomIndex = fViewer.getBottomIndex();
int focusIndex = -1;
boolean focusVisible = false;
- boolean isScrollingUp = fViewer.isUserTriggeredScrolling() && fViewer.getLastTopPixel() >= styledText.getTopPixel();
+ boolean isScrollingUp = fViewer.isUserTriggeredScrolling()
+ && fViewer.getLastTopPixel() >= styledText.getTopPixel();
if (fFocusPos != null) {
try {
int focusOffset = fFocusPos.offset;
@@ -1565,16 +1605,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
AddressRangePosition bestPosition = null;
int bestLine = -1;
BigInteger bestDistance = null;
- if (DEBUG) System.out.println("DisassemblyPart.updateVisibleArea() called. There are " + fDocument.getInvalidAddressRanges().length + " invalid ranges to consider updating"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (DEBUG)
+ System.out.println("DisassemblyPart.updateVisibleArea() called. There are " //$NON-NLS-1$
+ + fDocument.getInvalidAddressRanges().length + " invalid ranges to consider updating"); //$NON-NLS-1$
for (AddressRangePosition p : fDocument.getInvalidAddressRanges()) {
try {
int line = fDocument.getLineOfOffset(p.offset);
if (line >= topIndex && line <= bottomIndex) {
- if (p instanceof DisassemblyPosition || p.fAddressLength.compareTo(
- BigInteger.valueOf(fBufferZone * 2)) <= 0) {
+ if (p instanceof DisassemblyPosition
+ || p.fAddressLength.compareTo(BigInteger.valueOf(fBufferZone * 2)) <= 0) {
// small areas and known areas are OK to update
- } else if (!isScrollingUp && !fUpdateBeforeFocus
- && p.fAddressOffset.compareTo(focusAddress) < 0) {
+ } else if (!isScrollingUp && !fUpdateBeforeFocus && p.fAddressOffset.compareTo(focusAddress) < 0) {
continue;
}
BigInteger distance = p.fAddressOffset.subtract(focusAddress).abs();
@@ -1592,8 +1633,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
}
if (bestPosition != null) {
- if (DEBUG) System.out.println("...and the best candidate is: " + bestPosition); //$NON-NLS-1$
- int lines = fBufferZone+3;
+ if (DEBUG)
+ System.out.println("...and the best candidate is: " + bestPosition); //$NON-NLS-1$
+ int lines = fBufferZone + 3;
BigInteger startAddress = bestPosition.fAddressOffset;
BigInteger endAddress = bestPosition.fAddressOffset.add(bestPosition.fAddressLength);
BigInteger addressRange = BigInteger.valueOf(lines * fDocument.getMeanSizeOfInstructions());
@@ -1603,7 +1645,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
// try to increase range to reduce number of requests
Iterator<?> iter = fDocument.getModelPositionIterator(endAddress);
while (iter.hasNext()) {
- AddressRangePosition p = (AddressRangePosition)iter.next();
+ AddressRangePosition p = (AddressRangePosition) iter.next();
if (p.fValid) {
endAddress = endAddress.add(p.fAddressLength);
if (endAddress.subtract(startAddress).compareTo(addressRange) >= 0) {
@@ -1621,8 +1663,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
lines = endAddress.subtract(startAddress).intValue();
}
retrieveDisassembly(startAddress, endAddress, lines);
- }
- else {
+ } else {
if (DEBUG) {
System.out.println("...but alas we didn't deem any of them worth updating. They are:"); //$NON-NLS-1$
int i = 0;
@@ -1643,9 +1684,11 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fViewer.getControl().getDisplay().asyncExec(runnable);
}
}
+
private void invokeLater(Runnable runnable) {
invokeLater(10, runnable);
}
+
private void invokeLater(int delay, Runnable runnable) {
if (fViewer != null) {
fViewer.getControl().getDisplay().timerExec(delay, runnable);
@@ -1654,7 +1697,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
/**
* Insert source lines if available.
- *
+ *
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#updateInvalidSource()
*/
@Override
@@ -1667,10 +1710,10 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
try {
if (fScrollPos == null) {
if (fUpdatePending) {
- fUpdateSourcePending= true;
+ fUpdateSourcePending = true;
return;
}
- fUpdateSourcePending= false;
+ fUpdateSourcePending = false;
unlock = true;
fUpdatePending = true;
lockScroller();
@@ -1680,7 +1723,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (!p.fValid) {
insertSource(p);
} else if (DEBUG && fDocument.removeInvalidSourcePosition(p)) {
- System.err.println("!!! valid source position in invalid source list at "+ getAddressText(p.fAddressOffset)); //$NON-NLS-1$
+ System.err.println(
+ "!!! valid source position in invalid source list at " + getAddressText(p.fAddressOffset)); //$NON-NLS-1$
}
}
} finally {
@@ -1696,7 +1740,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
* Show disassembly for given (source) file. Retrieves disassembly starting
* at the beginning of the file, for as many lines as are specified. If
* [lines] == -1, the entire file is disassembled.
- *
+ *
* @param file
* @param lines
*/
@@ -1704,20 +1748,22 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (fDebugSessionId == null) {
return;
}
- startUpdate(new Runnable() {
- @Override
+ startUpdate(new Runnable() {
+ @Override
public void run() {
- if (DEBUG) System.out.println("retrieveDisassembly "+file); //$NON-NLS-1$
- fBackend.retrieveDisassembly(file, lines, fEndAddress, mixed, fShowSymbols, fShowDisassembly);
- }
- });
+ if (DEBUG)
+ System.out.println("retrieveDisassembly " + file); //$NON-NLS-1$
+ fBackend.retrieveDisassembly(file, lines, fEndAddress, mixed, fShowSymbols, fShowDisassembly);
+ }
+ });
}
private void retrieveDisassembly(BigInteger startAddress, BigInteger endAddress, int lines) {
if (fDebugSessionId == null) {
return;
}
- if (DEBUG) System.out.println("retrieveDisassembly "+getAddressText(startAddress)+" "+lines+" lines"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (DEBUG)
+ System.out.println("retrieveDisassembly " + getAddressText(startAddress) + " " + lines + " lines"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
retrieveDisassembly(startAddress, endAddress, lines, fShowSource, true);
}
@@ -1725,29 +1771,33 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#retrieveDisassembly(java.math.BigInteger, java.math.BigInteger, int, boolean, boolean)
*/
@Override
- public void retrieveDisassembly(final BigInteger startAddress, BigInteger endAddress, final int linesHint, boolean mixed, boolean ignoreFile) {
+ public void retrieveDisassembly(final BigInteger startAddress, BigInteger endAddress, final int linesHint,
+ boolean mixed, boolean ignoreFile) {
assert isGuiThread();
assert !fUpdatePending;
fUpdatePending = true;
- final int lines= linesHint + 2;
- final BigInteger addressLength= BigInteger.valueOf(lines * 4);
+ final int lines = linesHint + 2;
+ final BigInteger addressLength = BigInteger.valueOf(lines * 4);
if (endAddress.subtract(startAddress).compareTo(addressLength) > 0) {
- endAddress= startAddress.add(addressLength);
+ endAddress = startAddress.add(addressLength);
}
- boolean insideActiveFrame= startAddress.equals(fFrameAddress);
- String file= null;
- int lineNumber= -1;
+ boolean insideActiveFrame = startAddress.equals(fFrameAddress);
+ String file = null;
+ int lineNumber = -1;
if (!ignoreFile && insideActiveFrame && fBackend != null) {
- file= fBackend.getFrameFile();
+ file = fBackend.getFrameFile();
if (file != null && file.trim().length() == 0) {
file = null;
}
if (file != null) {
- lineNumber= fBackend.getFrameLine();
+ lineNumber = fBackend.getFrameLine();
}
}
- if (DEBUG) System.out.println("Asking backend to retrieve disassembly: sa=0x" + startAddress.toString(16) + ",ea=0x" + endAddress.toString(16) + ",file=" + file + ",lineNumber=" + lineNumber + ",lines=" + lines); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- fBackend.retrieveDisassembly(startAddress, endAddress, file, lineNumber, lines, mixed, fShowSymbols, fShowDisassembly, linesHint);
+ if (DEBUG)
+ System.out.println("Asking backend to retrieve disassembly: sa=0x" + startAddress.toString(16) + ",ea=0x" //$NON-NLS-1$//$NON-NLS-2$
+ + endAddress.toString(16) + ",file=" + file + ",lineNumber=" + lineNumber + ",lines=" + lines); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ fBackend.retrieveDisassembly(startAddress, endAddress, file, lineNumber, lines, mixed, fShowSymbols,
+ fShowDisassembly, linesHint);
}
/* (non-Javadoc)
@@ -1776,20 +1826,20 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
assert isGuiThread();
return fAddressSize;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#addressSizeChanged(int)
*/
@Override
public void addressSizeChanged(int addressSize) {
assert isGuiThread();
- BigInteger oldEndAddress= fEndAddress;
- fEndAddress= BigInteger.ONE.shiftLeft(addressSize);
- int oldAddressSize= fAddressSize;
- fAddressSize= addressSize;
+ BigInteger oldEndAddress = fEndAddress;
+ fEndAddress = BigInteger.ONE.shiftLeft(addressSize);
+ int oldAddressSize = fAddressSize;
+ fAddressSize = addressSize;
if (addressSize < oldAddressSize) {
fDocument.deleteDisassemblyRange(fEndAddress, oldEndAddress, true, true);
- List<AddressRangePosition> toRemove= new ArrayList<AddressRangePosition>();
+ List<AddressRangePosition> toRemove = new ArrayList<AddressRangePosition>();
for (AddressRangePosition position : fDocument.getInvalidAddressRanges()) {
if (position.fAddressOffset.compareTo(fEndAddress) >= 0) {
try {
@@ -1799,8 +1849,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
} catch (BadLocationException exc) {
internalError(exc);
}
- } else if (position.containsAddress(fEndAddress)){
- position.fAddressLength= fEndAddress.subtract(position.fAddressOffset);
+ } else if (position.containsAddress(fEndAddress)) {
+ position.fAddressLength = fEndAddress.subtract(position.fAddressOffset);
}
}
fDocument.removeInvalidAddressRanges(toRemove);
@@ -1810,14 +1860,14 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
return;
}
AddressRulerColumn fAddressRulerColumn = (AddressRulerColumn) getRulerColumn(AddressRulerColumn.ID);
- if (fAddressRulerColumn != null) {
+ if (fAddressRulerColumn != null) {
fAddressRulerColumn.setAddressSize(addressSize);
if (fComposite != null) {
fComposite.layout(true);
}
}
}
-
+
private IContributedRulerColumn getRulerColumn(String id) {
CompositeRuler compositeRuler = (CompositeRuler) getVerticalRuler();
for (Iterator<?> iter = compositeRuler.getDecoratorIterator(); iter.hasNext();) {
@@ -1859,7 +1909,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
protected void setActive(boolean active) {
- if (DEBUG) System.out.println("setActive("+ active +")"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (DEBUG)
+ System.out.println("setActive(" + active + ")"); //$NON-NLS-1$ //$NON-NLS-2$
fActive = active;
if (fActive) {
if (fRefreshAll) {
@@ -1870,7 +1921,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (fBackend != null && fBackend.hasDebugContext()) {
int frame = getActiveStackFrame();
if (frame < 0 && isSuspended()) {
- frame= 0;
+ frame = 0;
}
if (frame != fTargetFrame) {
gotoFrame(frame);
@@ -1878,7 +1929,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
}
} else {
- fGotoAddressPending= fFocusAddress= PC_UNKNOWN;
+ fGotoAddressPending = fFocusAddress = PC_UNKNOWN;
}
firePropertyChange(PROP_ACTIVE);
}
@@ -1900,7 +1951,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
IDisassemblyBackend contextBackend = fDebugContext.getAdapter(IDisassemblyBackend.class);
// Need to compare the backend classes to prevent reusing the same backend object.
// sub class can overwrite the standard disassembly backend to provide its own customization.
- if ((prevBackend != null) && (contextBackend != null) && prevBackend.getClass().equals(contextBackend.getClass()) && prevBackend.supportsDebugContext(fDebugContext)) {
+ if ((prevBackend != null) && (contextBackend != null)
+ && prevBackend.getClass().equals(contextBackend.getClass())
+ && prevBackend.supportsDebugContext(fDebugContext)) {
newBackend = prevBackend;
} else {
needUpdate = true;
@@ -1949,6 +2002,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
public void run() {
update.run();
}
+
@Override
public void handleException(Throwable e) {
internalError(e);
@@ -1972,15 +2026,16 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
private void debugContextChanged() {
- if (DEBUG) System.out.println("DisassemblyPart.debugContextChanged()"); //$NON-NLS-1$
- fUpdateCount++;
+ if (DEBUG)
+ System.out.println("DisassemblyPart.debugContextChanged()"); //$NON-NLS-1$
+ fUpdateCount++;
fRunnableQueue.clear();
fUpdatePending = false;
resetViewer();
if (fDebugSessionId != null) {
fJumpToAddressAction.setEnabled(true);
if (fAddressBar != null)
- fAddressBar.enableAddressBox(true);
+ fAddressBar.enableAddressBox(true);
int activeFrame = getActiveStackFrame();
if (activeFrame > 0) {
@@ -1989,20 +2044,20 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
updatePC(PC_UNKNOWN);
}
- if (fGotoAddressPending != PC_UNKNOWN) {
- gotoAddress(fGotoAddressPending);
- }
- if (fGotoMarkerPending != null) {
- gotoMarker(fGotoMarkerPending);
- }
+ if (fGotoAddressPending != PC_UNKNOWN) {
+ gotoAddress(fGotoAddressPending);
+ }
+ if (fGotoMarkerPending != null) {
+ gotoMarker(fGotoMarkerPending);
+ }
fViewer.addViewportListener(this);
- } else {
- fJumpToAddressAction.setEnabled(false);
- if (fAddressBar != null)
- fAddressBar.enableAddressBox(false);
+ } else {
+ fJumpToAddressAction.setEnabled(false);
+ if (fAddressBar != null)
+ fAddressBar.enableAddressBox(false);
fViewer.removeViewportListener(this);
- fGotoMarkerPending = null;
- }
+ fGotoMarkerPending = null;
+ }
updateTitle();
updateStateDependentActions();
firePropertyChange(PROP_CONNECTED);
@@ -2012,16 +2067,16 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
private void attachExtendedPCAnnotationModel() {
IAnnotationModel annotationModel = fViewer.getAnnotationModel();
if (annotationModel instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension ame= (IAnnotationModelExtension) annotationModel;
+ IAnnotationModelExtension ame = (IAnnotationModelExtension) annotationModel;
fExtPCAnnotationModel = new DisassemblyAnnotationModel();
ame.addAnnotationModel(EXTENDED_PC_ANNOTATIONS, fExtPCAnnotationModel);
}
}
-
+
private void attachBreakpointsAnnotationModel() {
IAnnotationModel annotationModel = fViewer.getAnnotationModel();
if (annotationModel instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension ame= (IAnnotationModelExtension) annotationModel;
+ IAnnotationModelExtension ame = (IAnnotationModelExtension) annotationModel;
ame.addAnnotationModel(BREAKPOINT_ANNOTATIONS, new BreakpointsAnnotationModel(fDebugContext));
}
}
@@ -2039,14 +2094,15 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fRefreshViewPending = false;
long now = System.currentTimeMillis();
if (now >= refreshViewScheduled) {
- if (DEBUG) System.err.println("*** refreshing view ***"); //$NON-NLS-1$
-
+ if (DEBUG)
+ System.err.println("*** refreshing view ***"); //$NON-NLS-1$
+
// save viewport position and frame info
BigInteger topAddress = getTopAddress();
- int targetFrame= fTargetFrame;
+ int targetFrame = fTargetFrame;
BigInteger frameAddress = fFrameAddress;
BigInteger pcAddress = fPCAddress;
-
+
// clear viewer
resetViewer();
if (fScrollPos != null) {
@@ -2060,15 +2116,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fPCAddress = pcAddress;
gotoAddress(topAddress);
} else {
- refreshView((int)(refreshViewScheduled - now));
+ refreshView((int) (refreshViewScheduled - now));
}
- }};
+ }
+ };
if (delay > 0) {
invokeLater(delay, new Runnable() {
@Override
public void run() {
doScrollLocked(refresh);
- }});
+ }
+ });
} else {
doScrollLocked(refresh);
}
@@ -2083,7 +2141,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
topAddress = getAddressOfLine(fViewer.getTopIndex() + 1);
}
return topAddress;
-
+
} else {
return PC_UNKNOWN;
}
@@ -2104,14 +2162,14 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fFile2Storage.clear();
fDocument.clear();
fViewer.setDocument(fDocument, new AnnotationModel());
- if (fDebugSessionId != null) {
- attachBreakpointsAnnotationModel();
- attachExtendedPCAnnotationModel();
+ if (fDebugSessionId != null) {
+ attachBreakpointsAnnotationModel();
+ attachExtendedPCAnnotationModel();
fDocument.insertInvalidAddressRange(0, 0, fStartAddress, fEndAddress);
- }
+ }
}
- private AddressRangePosition getPCPosition(BigInteger address) {
+ private AddressRangePosition getPCPosition(BigInteger address) {
if (address.compareTo(BigInteger.ZERO) < 0) {
// invalid address
return null;
@@ -2129,7 +2187,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (!(pos instanceof DisassemblyPosition)) {
return pos;
}
- String srcFile = ((DisassemblyPosition)pos).getFile();
+ String srcFile = ((DisassemblyPosition) pos).getFile();
if (srcFile == null) {
return pos;
}
@@ -2144,7 +2202,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
return null;
}
- int stmtLine = ((DisassemblyPosition)pos).getLine();
+ int stmtLine = ((DisassemblyPosition) pos).getLine();
if (stmtLine < 0) {
return pos;
}
@@ -2155,46 +2213,46 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
int offset = srcPos.offset;
int length = srcPos.length;
return new AddressRangePosition(offset, length, address, BigInteger.ZERO);
- }
+ }
- /**
+ /**
* Update the annotation indicating the given address.
* @return a position which denotes the documents position
*/
private AddressRangePosition updateAddressAnnotation(Annotation annotation, BigInteger address) {
if (fViewer == null) {
- return null; // can happen during session shutdown
+ return null; // can happen during session shutdown
}
IAnnotationModel annotationModel = fViewer.getAnnotationModel();
annotationModel.removeAnnotation(annotation);
AddressRangePosition pos = getPCPosition(address);
if (pos != null) {
- annotationModel.addAnnotation(annotation, new Position(pos.offset, Math.max(0, pos.length-1)));
+ annotationModel.addAnnotation(annotation, new Position(pos.offset, Math.max(0, pos.length - 1)));
}
return pos;
}
public IBreakpoint[] getBreakpointsAtLine(int line) {
- BreakpointsAnnotationModel bpModel= null;
- IAnnotationModel am= fViewer.getAnnotationModel();
+ BreakpointsAnnotationModel bpModel = null;
+ IAnnotationModel am = fViewer.getAnnotationModel();
if (am instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension ame= (IAnnotationModelExtension) am;
- bpModel= (BreakpointsAnnotationModel) ame.getAnnotationModel(BREAKPOINT_ANNOTATIONS);
+ IAnnotationModelExtension ame = (IAnnotationModelExtension) am;
+ bpModel = (BreakpointsAnnotationModel) ame.getAnnotationModel(BREAKPOINT_ANNOTATIONS);
if (bpModel != null) {
IRegion lineRegion;
try {
- lineRegion= fDocument.getLineInformation(line);
+ lineRegion = fDocument.getLineInformation(line);
} catch (BadLocationException exc) {
return null;
}
- int offset= lineRegion.getOffset();
- int length= lineRegion.getLength();
- Iterator<Annotation> it= bpModel.getAnnotationIterator(offset, length, true, true);
- List<IBreakpoint> bpList= new ArrayList<IBreakpoint>(5);
- final IBreakpointManager bpMgr= DebugPlugin.getDefault().getBreakpointManager();
+ int offset = lineRegion.getOffset();
+ int length = lineRegion.getLength();
+ Iterator<Annotation> it = bpModel.getAnnotationIterator(offset, length, true, true);
+ List<IBreakpoint> bpList = new ArrayList<IBreakpoint>(5);
+ final IBreakpointManager bpMgr = DebugPlugin.getDefault().getBreakpointManager();
while (it.hasNext()) {
- final SimpleMarkerAnnotation annotation= (SimpleMarkerAnnotation) it.next();
- IBreakpoint bp= bpMgr.getBreakpoint(annotation.getMarker());
+ final SimpleMarkerAnnotation annotation = (SimpleMarkerAnnotation) it.next();
+ IBreakpoint bp = bpMgr.getBreakpoint(annotation.getMarker());
if (bp != null) {
bpList.add(bp);
}
@@ -2213,7 +2271,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
@Override
public void gotoFrame(int frame) {
assert isGuiThread();
- fGotoAddressPending = PC_UNKNOWN;
+ fGotoAddressPending = PC_UNKNOWN;
gotoFrame(frame, PC_UNKNOWN);
}
@@ -2237,8 +2295,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
@Override
public void gotoFrame(int frame, BigInteger address) {
assert isGuiThread();
- if (DEBUG) System.out.println("gotoFrame " + frame + " " + getAddressText(address)); //$NON-NLS-1$ //$NON-NLS-2$
-
+ if (DEBUG)
+ System.out.println("gotoFrame " + frame + " " + getAddressText(address)); //$NON-NLS-1$ //$NON-NLS-2$
+
// cache the last PC address
if (!isSyncWithActiveDebugContext()) {
if (isTrackExpression()) {
@@ -2248,26 +2307,26 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (fPCLastAddress != PC_UNKNOWN) {
address = fPCLastAddress;
} else if (address != PC_UNKNOWN) {
- fPCLastAddress = address;
+ fPCLastAddress = address;
}
-
+
// need to get the frame address when the view first started.
if (fPCLastAddress != PC_UNKNOWN)
frame = -2; // clear the annotation
} else {
fPCLastAddress = address;
}
-
- if (fGotoAddressPending == fFrameAddress) {
- // cancel goto address from previous goto frame
- fGotoAddressPending = PC_UNKNOWN;
- }
+
+ if (fGotoAddressPending == fFrameAddress) {
+ // cancel goto address from previous goto frame
+ fGotoAddressPending = PC_UNKNOWN;
+ }
fTargetFrame = frame;
fFrameAddress = address;
if (fTargetFrame == -1) {
fTargetFrame = getActiveStackFrame();
if (fTargetFrame < 0 && fBackend != null && fBackend.canDisassemble()) {
- fTargetFrame= 0;
+ fTargetFrame = 0;
}
if (fTargetFrame == -1) {
fGotoFramePending = false;
@@ -2282,7 +2341,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (!fUpdatePending) {
fGotoFramePending = false;
if (fBackend != null && fBackend.hasDebugContext() && fBackend.canDisassemble()) {
- if (DEBUG) System.out.println("retrieveFrameAddress "+frame); //$NON-NLS-1$
+ if (DEBUG)
+ System.out.println("retrieveFrameAddress " + frame); //$NON-NLS-1$
fUpdatePending = true;
fBackend.retrieveFrameAddress(fTargetFrame);
}
@@ -2319,7 +2379,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
public final boolean isActive() {
return fActive;
}
-
+
/*
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyPart#isConnected()
*/
@@ -2328,7 +2388,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (fDebugSessionId == null) {
return false;
}
-
+
return (fBackend != null) ? fBackend.hasDebugContext() : false;
}
@@ -2347,7 +2407,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
public final ISourceViewer getTextViewer() {
return fViewer;
}
-
+
@Override
public final boolean hasViewer() {
return fViewer != null;
@@ -2374,7 +2434,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
* Should return a <code>Long</code> object in case the value was computed,
* another object to be waited on if the retrieval is in progress, <code>null</code>
* if no time stamp could be retrieved.
- *
+ *
* @param address
* @return Long, Object or <code>null</code>
*/
@@ -2421,7 +2481,8 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
private void addToPCHistory(AddressRangePosition pcPos) {
- if (DEBUG) System.out.println("addToPCHistory "+getAddressText(pcPos.fAddressOffset)); //$NON-NLS-1$
+ if (DEBUG)
+ System.out.println("addToPCHistory " + getAddressText(pcPos.fAddressOffset)); //$NON-NLS-1$
if (fPCHistorySizeMax <= 1) {
return;
}
@@ -2452,7 +2513,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fViewer.invalidateTextPresentation(last.offset, last.length);
}
// redraw
- for (Iterator<AddressRangePosition> it=fPCHistory.iterator(); it.hasNext();) {
+ for (Iterator<AddressRangePosition> it = fPCHistory.iterator(); it.hasNext();) {
AddressRangePosition pos = it.next();
fViewer.invalidateTextPresentation(pos.offset, pos.length);
}
@@ -2470,9 +2531,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
public void updatePC(BigInteger pc) {
assert isGuiThread();
if (!fPendingPCUpdates.isEmpty()) {
- BigInteger last = fPendingPCUpdates.get(fPendingPCUpdates.size()-1);
+ BigInteger last = fPendingPCUpdates.get(fPendingPCUpdates.size() - 1);
if (last.compareTo(BigInteger.ZERO) < 0) {
- fPendingPCUpdates.remove(fPendingPCUpdates.size()-1);
+ fPendingPCUpdates.remove(fPendingPCUpdates.size() - 1);
}
}
fPendingPCUpdates.add(pc);
@@ -2509,7 +2570,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
// set primary
pos = updateAddressAnnotation(fPCAnnotation, fPCAddress);
} else if (fTargetFrame < 0) {
- // clear both
+ // clear both
updateAddressAnnotation(fPCAnnotation, PC_UNKNOWN);
updateAddressAnnotation(fSecondaryPCAnnotation, PC_UNKNOWN);
} else {
@@ -2519,11 +2580,11 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
pos = updateAddressAnnotation(fSecondaryPCAnnotation, fFrameAddress);
}
fPCAnnotationUpdatePending = pos == null && fFrameAddress.compareTo(BigInteger.ZERO) >= 0;
-
+
if (fExtPCAnnotationModel != null) {
fBackend.updateExtendedPCAnnotation(fExtPCAnnotationModel);
}
-
+
return pos;
}
@@ -2552,7 +2613,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (fUpdateSourcePending) {
updateInvalidSource();
}
- boolean sourceValid= !fDocument.hasInvalidSourcePositions();
+ boolean sourceValid = !fDocument.hasInvalidSourcePositions();
if (sourceValid || fShowDisassembly) {
if (fGotoFramePending) {
gotoFrame(fTargetFrame, fFrameAddress);
@@ -2588,49 +2649,50 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
if (!fActive) {
// refresh all when becoming active again
- fRefreshViewPending= false;
+ fRefreshViewPending = false;
fRefreshAll = true;
return;
}
if (doit != null) {
fRunnableQueue.add(doit);
}
- final int updateCount = fUpdateCount;
- if (fUpdatePending) {
- if (fRunnableQueue.size() == 1) {
- Runnable doitlater = new Runnable() {
- @Override
+ final int updateCount = fUpdateCount;
+ if (fUpdatePending) {
+ if (fRunnableQueue.size() == 1) {
+ Runnable doitlater = new Runnable() {
+ @Override
public void run() {
- if (updateCount == fUpdateCount) {
- doScrollLocked(null);
- }
- }};
- invokeLater(doitlater);
- }
- } else {
- fUpdatePending = true;
- lockScroller();
- try {
- ArrayList<Runnable> copy = new ArrayList<Runnable>(fRunnableQueue);
- fRunnableQueue.clear();
- for (Iterator<Runnable> iter = copy.iterator(); iter.hasNext();) {
- if (updateCount != fUpdateCount) {
- return;
- }
- Runnable doitnow = iter.next();
- try {
- doitnow.run();
- } catch(Exception e) {
- internalError(e);
- }
- }
- } finally {
- fUpdatePending = false;
- unlockScroller();
- doPending();
- updateVisibleArea();
- }
- }
+ if (updateCount == fUpdateCount) {
+ doScrollLocked(null);
+ }
+ }
+ };
+ invokeLater(doitlater);
+ }
+ } else {
+ fUpdatePending = true;
+ lockScroller();
+ try {
+ ArrayList<Runnable> copy = new ArrayList<Runnable>(fRunnableQueue);
+ fRunnableQueue.clear();
+ for (Iterator<Runnable> iter = copy.iterator(); iter.hasNext();) {
+ if (updateCount != fUpdateCount) {
+ return;
+ }
+ Runnable doitnow = iter.next();
+ try {
+ doitnow.run();
+ } catch (Exception e) {
+ internalError(e);
+ }
+ }
+ } finally {
+ fUpdatePending = false;
+ unlockScroller();
+ doPending();
+ updateVisibleArea();
+ }
+ }
}
/* (non-Javadoc)
@@ -2661,7 +2723,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
AddressRangePosition pos = fDocument.getDisassemblyPosition(focusOffset);
if (pos != null && !pos.fValid) {
// don't lock position of invalid range
- focusOffset = pos.offset+pos.length;
+ focusOffset = pos.offset + pos.length;
focusLine = fDocument.getLineOfOffset(focusOffset);
}
}
@@ -2700,10 +2762,10 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
int topLine = fDocument.getLineOfOffset(fScrollPos.offset) - fScrollLine;
// limit text size
int lineCount = fDocument.getNumberOfLines();
- if (lineCount > fgHighWaterMark*fBufferZone) {
- int startLine = Math.max(0, topLine-fgLowWaterMark/2*fBufferZone);
- int endLine = Math.min(lineCount-1, topLine+fgLowWaterMark/2*fBufferZone);
- fDocument.deleteLineRange(endLine, lineCount-1);
+ if (lineCount > fgHighWaterMark * fBufferZone) {
+ int startLine = Math.max(0, topLine - fgLowWaterMark / 2 * fBufferZone);
+ int endLine = Math.min(lineCount - 1, topLine + fgLowWaterMark / 2 * fBufferZone);
+ fDocument.deleteLineRange(endLine, lineCount - 1);
fDocument.deleteLineRange(0, startLine);
}
int lineHeight = fViewer.getTextWidget().getLineHeight();
@@ -2727,31 +2789,31 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#insertSource(org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition)
- */
- @Override
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#insertSource(org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition)
+ */
+ @Override
public void insertSource(AddressRangePosition _pos) {
- assert isGuiThread();
+ assert isGuiThread();
// IDisassemblyPartCallback does not have visibility to the
// SourcePosition type, which is DSF-specific, so it uses the base type
- if (!(_pos instanceof SourcePosition)) {
- assert false : "Caller should have passed in a SourcePosition"; //$NON-NLS-1$
- return;
- }
- SourcePosition pos = (SourcePosition)_pos;
-
- if (!fShowSource) {
- fDocument.insertSource(pos, "", pos.fLine, true); //$NON-NLS-1$
- return;
- }
- SourceFileInfo fi = pos.fFileInfo;
+ if (!(_pos instanceof SourcePosition)) {
+ assert false : "Caller should have passed in a SourcePosition"; //$NON-NLS-1$
+ return;
+ }
+ SourcePosition pos = (SourcePosition) _pos;
+
+ if (!fShowSource) {
+ fDocument.insertSource(pos, "", pos.fLine, true); //$NON-NLS-1$
+ return;
+ }
+ SourceFileInfo fi = pos.fFileInfo;
if (fi.fSource != null || fi.fError != null) {
- int lineNr = pos.fLine;
+ int lineNr = pos.fLine;
if (fi.fSource != null && lineNr >= 0 && lineNr < fi.fSource.getNumberOfLines()) {
fi.fStartAddress = fi.fStartAddress.min(pos.fAddressOffset);
fi.fEndAddress = fi.fEndAddress.max(pos.fAddressOffset.add(pos.fAddressLength));
- int last = pos.fLast > lineNr ? pos.fLast : lineNr;
+ int last = pos.fLast > lineNr ? pos.fLast : lineNr;
final BigInteger lineAddr = fi.fLine2Addr[lineNr];
if (lineAddr == null) {
fi.fLine2Addr[lineNr] = pos.fAddressOffset;
@@ -2765,9 +2827,11 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
if (oldPos != null) {
// test if source positions are consecutive
try {
- int index = fDocument.computeIndexInCategory(DisassemblyDocument.CATEGORY_SOURCE, pos.fAddressOffset);
+ int index = fDocument.computeIndexInCategory(DisassemblyDocument.CATEGORY_SOURCE,
+ pos.fAddressOffset);
if (index >= 0) {
- SourcePosition nextPos = (SourcePosition) fDocument.getPositionOfIndex(DisassemblyDocument.CATEGORY_SOURCE, index+1);
+ SourcePosition nextPos = (SourcePosition) fDocument
+ .getPositionOfIndex(DisassemblyDocument.CATEGORY_SOURCE, index + 1);
if (nextPos.fFileInfo == fi && nextPos.fLine == lineNr) {
fDocument.replace(oldPos, oldPos.length, ""); //$NON-NLS-1$
fDocument.removeSourcePosition(oldPos);
@@ -2789,9 +2853,11 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
// new source position is after old position
try {
// test if source positions are consecutive
- int index = fDocument.computeIndexInCategory(DisassemblyDocument.CATEGORY_SOURCE, pos.fAddressOffset);
+ int index = fDocument.computeIndexInCategory(DisassemblyDocument.CATEGORY_SOURCE,
+ pos.fAddressOffset);
if (index > 0) {
- SourcePosition prevPos = (SourcePosition) fDocument.getPositionOfIndex(DisassemblyDocument.CATEGORY_SOURCE, index-1);
+ SourcePosition prevPos = (SourcePosition) fDocument
+ .getPositionOfIndex(DisassemblyDocument.CATEGORY_SOURCE, index - 1);
if (prevPos.fFileInfo == fi && prevPos.fLine == lineNr) {
fDocument.insertSource(pos, "", lineNr, true); //$NON-NLS-1$
fDocument.removeSourcePosition(pos);
@@ -2816,29 +2882,29 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
}
- private void updateTitle() {
- if (fDebugSessionId == null) {
- String descr = DisassemblyMessages.Disassembly_message_notConnected;
- String title = getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
- setPartName(title);
- setContentDescription(descr);
- setTitleToolTip(title);
- } else {
- // TLETODO Proper content description
- setContentDescription(""); //$NON-NLS-1$
- }
- }
+ private void updateTitle() {
+ if (fDebugSessionId == null) {
+ String descr = DisassemblyMessages.Disassembly_message_notConnected;
+ String title = getConfigurationElement().getAttribute("name"); //$NON-NLS-1$
+ setPartName(title);
+ setContentDescription(descr);
+ setTitleToolTip(title);
+ } else {
+ // TLETODO Proper content description
+ setContentDescription(""); //$NON-NLS-1$
+ }
+ }
- /**
+ /**
* Close this part
*/
protected abstract void closePart();
@Override
- public void applyTextPresentation(TextPresentation textPresentation) {
+ public void applyTextPresentation(TextPresentation textPresentation) {
IRegion coverage = textPresentation.getExtent();
if (coverage == null) {
- coverage= new Region(0, fDocument.getLength());
+ coverage = new Region(0, fDocument.getLength());
}
int startOffset = coverage.getOffset();
int length = coverage.getLength();
@@ -2858,27 +2924,28 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
return;
}
ArrayList<StyleRange> styleRanges = new ArrayList<StyleRange>();
- while(it.hasNext()) {
- AddressRangePosition pos = (AddressRangePosition)it.next();
+ while (it.hasNext()) {
+ AddressRangePosition pos = (AddressRangePosition) it.next();
if (pos.offset >= endOffset) {
break;
}
- if (pos.offset+pos.length <= startOffset) {
+ if (pos.offset + pos.length <= startOffset) {
continue;
}
if (pos.fValid && pos.length > 0) {
if (pos instanceof DisassemblyPosition) {
- DisassemblyPosition disPos = (DisassemblyPosition)pos;
+ DisassemblyPosition disPos = (DisassemblyPosition) pos;
styleRanges.add(new StyleRange(pos.offset, disPos.length, fInstructionColor, null, SWT.NULL));
} else if (pos instanceof ErrorPosition) {
styleRanges.add(new StyleRange(pos.offset, pos.length, fErrorColor, null, SWT.NULL));
} else if (pos instanceof LabelPosition) {
styleRanges.add(new StyleRange(pos.offset, pos.length, fLabelColor, null, SWT.BOLD));
} else if (pos instanceof SourcePosition) {
- SourcePosition srcPos = (SourcePosition)pos;
+ SourcePosition srcPos = (SourcePosition) pos;
TextPresentation presentation = null;
if (srcPos.fFileInfo.fSource != null) {
- presentation = srcPos.fFileInfo.getPresentation(srcPos.fFileInfo.getRegion(srcPos.fLine, pos.length));
+ presentation = srcPos.fFileInfo
+ .getPresentation(srcPos.fFileInfo.getRegion(srcPos.fLine, pos.length));
}
if (presentation != null) {
// clip result window to coverage
@@ -2886,8 +2953,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
int end = Math.min(endOffset, srcPos.offset + srcPos.length);
int srcOffset = srcPos.fFileInfo.getLineOffset(srcPos.fLine);
int clipOffset = start - srcPos.offset;
- presentation.setResultWindow(new Region(srcOffset + clipOffset, end-start));
- for (Iterator<StyleRange> iter = presentation.getNonDefaultStyleRangeIterator(); iter.hasNext();) {
+ presentation.setResultWindow(new Region(srcOffset + clipOffset, end - start));
+ for (Iterator<StyleRange> iter = presentation.getNonDefaultStyleRangeIterator(); iter
+ .hasNext();) {
StyleRange styleRange = iter.next();
styleRange.start += srcPos.offset + clipOffset;
styleRanges.add(styleRange);
@@ -2906,9 +2974,10 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
// update pc history trail
if (fPCHistory.size() > 1) {
HSL hsv = new HSL(fPCAnnotationRGB);
- double luminanceStep = (1-hsv.luminance)/(fPCHistorySizeMax+1);
+ double luminanceStep = (1 - hsv.luminance) / (fPCHistorySizeMax + 1);
hsv.luminance = 1 - luminanceStep * (fPCHistorySizeMax - fPCHistory.size());
- for (ListIterator<AddressRangePosition> listIt = fPCHistory.listIterator(fPCHistory.size()); listIt.hasPrevious();) {
+ for (ListIterator<AddressRangePosition> listIt = fPCHistory.listIterator(fPCHistory.size()); listIt
+ .hasPrevious();) {
AddressRangePosition pcPos = listIt.previous();
hsv.luminance -= luminanceStep;
if (pcPos.isDeleted) {
@@ -2923,7 +2992,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
Color pcColor = getSharedColors().getColor(rgb);
Color textColor = null;
// experimental: if color is dark, use white (background) as text color
-// Color textColor = hsv.luminance < 0.7 ? fViewer.getTextWidget().getBackground() : null;
+ // Color textColor = hsv.luminance < 0.7 ? fViewer.getTextWidget().getBackground() : null;
textPresentation.mergeStyleRange(new StyleRange(pcPos.offset, pcPos.length, textColor, pcColor));
}
}
@@ -2931,11 +3000,14 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
@Override
- public AddressRangePosition insertSource(AddressRangePosition pos, BigInteger address, final String file, int lineNumber) {
+ public AddressRangePosition insertSource(AddressRangePosition pos, BigInteger address, final String file,
+ int lineNumber) {
return insertSource(pos, address, file, lineNumber, lineNumber);
}
+
@Override
- public AddressRangePosition insertSource(AddressRangePosition pos, BigInteger address, final String file, int firstLine, int lastLine) {
+ public AddressRangePosition insertSource(AddressRangePosition pos, BigInteger address, final String file,
+ int firstLine, int lastLine) {
assert isGuiThread();
Object sourceElement = null;
if (fFile2Storage.containsKey(file)) {
@@ -2944,17 +3016,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
sourceElement = fBackend.insertSource(pos, address, file, firstLine);
}
if (sourceElement instanceof File) {
- sourceElement = new LocalFileStorage((File)sourceElement);
- } else if (sourceElement instanceof ITranslationUnit) {
- IPath location = ((ITranslationUnit) sourceElement).getLocation();
- if (location != null) {
- sourceElement = new LocalFileStorage(location.toFile());
- }
+ sourceElement = new LocalFileStorage((File) sourceElement);
+ } else if (sourceElement instanceof ITranslationUnit) {
+ IPath location = ((ITranslationUnit) sourceElement).getLocation();
+ if (location != null) {
+ sourceElement = new LocalFileStorage(location.toFile());
+ }
}
if (sourceElement instanceof IStorage) {
if (!(sourceElement instanceof IFile)) {
// try to resolve as resource
- final IPath location= ((IStorage) sourceElement).getFullPath();
+ final IPath location = ((IStorage) sourceElement).getFullPath();
if (location != null) {
IFile iFile = ResourceLookup.selectFileForLocation(location, null);
if (iFile != null && iFile.isAccessible()) {
@@ -2965,18 +3037,18 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
fFile2Storage.put(file, sourceElement);
} else if (sourceElement == null) {
if (!fFile2Storage.containsKey(file)) {
- logWarning(DisassemblyMessages.Disassembly_log_error_locateFile+file, null);
- fFile2Storage.put(file, null);
+ logWarning(DisassemblyMessages.Disassembly_log_error_locateFile + file, null);
+ fFile2Storage.put(file, null);
}
} else {
- fFile2Storage.put(file, null);
- assert false : "missing support for source element of type " + sourceElement.getClass().toString(); //$NON-NLS-1$
+ fFile2Storage.put(file, null);
+ assert false : "missing support for source element of type " + sourceElement.getClass().toString(); //$NON-NLS-1$
}
-
+
if (sourceElement instanceof IStorage) {
- SourceFileInfo fi = fDocument.getSourceInfo((IStorage)sourceElement);
+ SourceFileInfo fi = fDocument.getSourceInfo((IStorage) sourceElement);
if (fi == null) {
- IStorage storage = (IStorage)sourceElement;
+ IStorage storage = (IStorage) sourceElement;
Display display = getSite().getShell().getDisplay();
Runnable done = new SourceColorerJob(display, storage, this);
fi = fDocument.createSourceInfo(file, storage, done);
@@ -2989,25 +3061,27 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
pos = fDocument.insertInvalidSource(pos, address, fi, firstLine, lastLine);
}
-
+
return pos;
}
-
+
public AddressBarContributionItem getAddressBar() {
return fAddressBar;
}
-
+
public void generateErrorDialog(String message) {
- MessageDialog messageDialog = new MessageDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), DisassemblyMessages.Disassembly_Error_Dialog_title, null, message, MessageDialog.ERROR, new String[]{DisassemblyMessages.Disassembly_Error_Dialog_ok_button}, 0);
+ MessageDialog messageDialog = new MessageDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+ DisassemblyMessages.Disassembly_Error_Dialog_title, null, message, MessageDialog.ERROR,
+ new String[] { DisassemblyMessages.Disassembly_Error_Dialog_ok_button }, 0);
messageDialog.open();
}
-
+
public void activateDisassemblyContext() {
IContextService ctxService = getSite().getService(IContextService.class);
- if (ctxService!=null)
+ if (ctxService != null)
fContextActivation = ctxService.activateContext(KEY_BINDING_CONTEXT_DISASSEMBLY);
}
-
+
public void deactivateDisassemblyContext() {
if (fContextActivation != null) {
IContextService ctxService = getSite().getService(IContextService.class);
@@ -3042,7 +3116,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
});
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#handleTargetEnded()
*/
@@ -3052,16 +3126,16 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
@Override
public void run() {
fDebugSessionId = null;
- startUpdate(new Runnable() {
- @Override
+ startUpdate(new Runnable() {
+ @Override
public void run() {
- debugContextChanged();
- }
- });
+ debugContextChanged();
+ }
+ });
}
});
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#setUpdatePending(boolean)
*/
@@ -3105,7 +3179,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
assert isGuiThread();
return fDocument;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#getStorageForFile(java.lang.String)
*/
@@ -3119,7 +3193,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
* A pass through to process the text to populate into a text hover.
*/
public String getHoverInfoData(AddressRangePosition pos, String ident) {
- if (fBackend != null ) {
+ if (fBackend != null) {
return fBackend.getHoverInfoData(pos, ident);
}
return ""; //$NON-NLS-1$
@@ -3134,7 +3208,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
return ""; //$NON-NLS-1$
}
-
+
/**
* A passthru from the text hover code to the backend.
*/
@@ -3144,7 +3218,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
return ""; //$NON-NLS-1$
}
-
+
public BigInteger eval(String expr, boolean suppressError) {
if (fBackend != null) {
BigInteger address = null;
@@ -3175,29 +3249,29 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
private void setTrackExpression(boolean track) {
fTrackExpression = track;
}
-
+
protected boolean isSyncWithActiveDebugContext() {
return fSynchWithActiveDebugContext;
}
-
+
private void setSyncWithDebugView(boolean sync) {
fSynchWithActiveDebugContext = sync;
fTrackExpressionAction.setEnabled(!sync);
-
+
if (sync) {
gotoActiveFrameByUser();
} else {
// redraw
while (!fPCHistory.isEmpty()) {
- AddressRangePosition pos = fPCHistory.removeFirst();
+ AddressRangePosition pos = fPCHistory.removeFirst();
fViewer.invalidateTextPresentation(pos.offset, pos.length);
}
-
+
fTargetFrame = -2; // clear the annotation
updatePCAnnotation();
}
}
-
+
/**
* Most methods in IDisassemblyPartCallback require execution on the GUI thread.
*/
@@ -3231,13 +3305,13 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
scrollToAddress = bottomAddress.add(addressRange).min(bottomAddress);
break;
default:
- assert false; // invalid keycode passed
+ assert false; // invalid keycode passed
scrollToAddress = fFocusAddress;
}
AddressRangePosition pos = getPositionOfAddress(scrollToAddress);
if (pos != null && pos.fValid) {
if (SWT.ARROW_DOWN == keyCode && pos.fAddressOffset.compareTo(bottomAddress) <= 0
- || SWT.ARROW_UP == keyCode && pos.fAddressOffset.compareTo(topAddress) >= 0) {
+ || SWT.ARROW_UP == keyCode && pos.fAddressOffset.compareTo(topAddress) >= 0) {
return false;
}
gotoPosition(pos, SWT.ARROW_DOWN != keyCode);
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblySelectionProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblySelectionProvider.java
index 64b6d77fab0..f2b12746c74 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblySelectionProvider.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblySelectionProvider.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
-
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.DisassemblySelection;
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
import org.eclipse.core.runtime.ListenerList;
@@ -38,7 +37,7 @@ class DisassemblySelectionProvider implements ISelectionProvider {
private final ListenerList<ISelectionChangedListener> fListenerList = new ListenerList<>(ListenerList.IDENTITY);
private final ISelectionChangedListener fListener = event -> fireSelectionChanged(event);
private final DisassemblyPart fPart;
-
+
DisassemblySelectionProvider(DisassemblyPart disassemblyPart) {
fPart = disassemblyPart;
fPart.getTextViewer().getSelectionProvider().addSelectionChangedListener(fListener);
@@ -53,12 +52,12 @@ class DisassemblySelectionProvider implements ISelectionProvider {
@Override
public void addSelectionChangedListener(ISelectionChangedListener listener) {
- fListenerList.add(listener);
+ fListenerList.add(listener);
}
@Override
public ISelection getSelection() {
- final ISourceViewer textViewer= fPart.getTextViewer();
+ final ISourceViewer textViewer = fPart.getTextViewer();
ISelectionProvider provider = textViewer.getSelectionProvider();
if (provider != null) {
return new DisassemblySelection((ITextSelection) provider.getSelection(), fPart);
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java
index 6bc2f4a1cc4..cdd4cd75327 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -38,13 +38,13 @@ public class DisassemblyTextHover implements ITextHover {
* Create a new disassembly text hover.
*/
public DisassemblyTextHover(DisassemblyPart part) {
- fDisassemblyPart= part;
+ fDisassemblyPart = part;
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer, int)
*/
- @Override
+ @Override
public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
IDocument doc = textViewer.getDocument();
return CWordFinder.findWord(doc, offset);
@@ -55,17 +55,17 @@ public class DisassemblyTextHover implements ITextHover {
*/
@Override
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
- DisassemblyDocument doc = (DisassemblyDocument)textViewer.getDocument();
+ DisassemblyDocument doc = (DisassemblyDocument) textViewer.getDocument();
int offset = hoverRegion.getOffset();
AddressRangePosition pos;
try {
String ident = doc.get(offset, hoverRegion.getLength());
String value = null;
pos = doc.getModelPosition(offset);
-
+
value = fDisassemblyPart.getHoverInfoData(pos, ident);
- // If returns null (or empty string), not implemented or something went wrong.
+ // If returns null (or empty string), not implemented or something went wrong.
if (value == null || value.length() == 0) {
if (pos instanceof SourcePosition) {
value = evaluateExpression(ident);
@@ -82,12 +82,12 @@ public class DisassemblyTextHover implements ITextHover {
if (value != null) {
return ident + " = " + value; //$NON-NLS-1$
}
- }
- else
+ } else
return value;
} catch (BadLocationException e) {
if (DsfUIPlugin.getDefault().isDebugging()) {
- DsfUIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, "Internal Error", e)); //$NON-NLS-1$
+ DsfUIPlugin.getDefault().getLog()
+ .log(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, "Internal Error", e)); //$NON-NLS-1$
}
}
return null;
@@ -99,7 +99,7 @@ public class DisassemblyTextHover implements ITextHover {
* @return register value or <code>null</code>
*/
private String evaluateRegister(String register) {
- return fDisassemblyPart.evaluateRegister(register);
+ return fDisassemblyPart.evaluateRegister(register);
}
/**
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyToggleBreakpointTester.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyToggleBreakpointTester.java
index bb0c10dfd06..4b5e6841670 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyToggleBreakpointTester.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyToggleBreakpointTester.java
@@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
- * Patrick Chuong (Texas Instruments) -
+ * Patrick Chuong (Texas Instruments) -
* Update CDT ToggleBreakpointTargetFactory enablement (340177 )
*****************************************************************/
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
@@ -26,7 +26,7 @@ import org.eclipse.debug.ui.DebugUITools;
/**
* Disassembly toggle breakpoint factory enablement tester.
- *
+ *
* @since 2.2
*/
public class DisassemblyToggleBreakpointTester extends PropertyTester {
@@ -40,25 +40,25 @@ public class DisassemblyToggleBreakpointTester extends PropertyTester {
if ("isDisassemblyViewSupportsCBreakpoint".equals(property) && (receiver instanceof IDisassemblyPart)) { //$NON-NLS-1$
IDisassemblyPart view = ((IDisassemblyPart) receiver);
if (!CDebugUtils.isCustomToggleBreakpointFactory())
- return true;
-
- IAdaptable element = DebugUITools.getPartDebugContext(view.getSite());
- if (element != null) {
- IDebugModelProvider modelProvider = element.getAdapter(IDebugModelProvider.class);
- if (modelProvider != null) {
- String[] models = modelProvider.getModelIdentifiers();
- for (String model : models) {
- if (CDIDebugModel.getPluginIdentifier().equals(model) ||
- ICBreakpoint.C_BREAKPOINTS_DEBUG_MODEL_ID.equals(model)) {
- return true;
- }
- }
- } else if (element instanceof IDebugElement) {
- if (CDIDebugModel.getPluginIdentifier().equals(((IDebugElement)element).getModelIdentifier()) ) {
- return true;
- }
- }
- }
+ return true;
+
+ IAdaptable element = DebugUITools.getPartDebugContext(view.getSite());
+ if (element != null) {
+ IDebugModelProvider modelProvider = element.getAdapter(IDebugModelProvider.class);
+ if (modelProvider != null) {
+ String[] models = modelProvider.getModelIdentifiers();
+ for (String model : models) {
+ if (CDIDebugModel.getPluginIdentifier().equals(model)
+ || ICBreakpoint.C_BREAKPOINTS_DEBUG_MODEL_ID.equals(model)) {
+ return true;
+ }
+ }
+ } else if (element instanceof IDebugElement) {
+ if (CDIDebugModel.getPluginIdentifier().equals(((IDebugElement) element).getModelIdentifier())) {
+ return true;
+ }
+ }
+ }
}
return false;
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java
index 56c1a2becfe..6136cd69129 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyView.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* Patrick Chuong (Texas Instruments) - Bug fix (326670)
@@ -32,7 +32,7 @@ import org.eclipse.ui.texteditor.ITextEditorActionConstants;
public class DisassemblyView extends DisassemblyPart implements IViewPart {
/**
- *
+ *
*/
public DisassemblyView() {
super();
@@ -48,7 +48,7 @@ public class DisassemblyView extends DisassemblyPart implements IViewPart {
*/
@Override
public IViewSite getViewSite() {
- return (IViewSite)getSite();
+ return (IViewSite) getSite();
}
/*
@@ -65,14 +65,14 @@ public class DisassemblyView extends DisassemblyPart implements IViewPart {
@Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
setSite(site);
- if (memento != null) {
- Boolean trackExpression = memento.getBoolean(DisassemblyPreferenceConstants.TRACK_EXPRESSION);
- if (trackExpression != null)
- fTrackExpression = trackExpression;
- Boolean syncContext = memento.getBoolean(DisassemblyPreferenceConstants.SYNC_ACTIVE_CONTEXT);
- if (syncContext != null)
- fSynchWithActiveDebugContext = syncContext;
- }
+ if (memento != null) {
+ Boolean trackExpression = memento.getBoolean(DisassemblyPreferenceConstants.TRACK_EXPRESSION);
+ if (trackExpression != null)
+ fTrackExpression = trackExpression;
+ Boolean syncContext = memento.getBoolean(DisassemblyPreferenceConstants.SYNC_ACTIVE_CONTEXT);
+ if (syncContext != null)
+ fSynchWithActiveDebugContext = syncContext;
+ }
}
/*
@@ -93,18 +93,18 @@ public class DisassemblyView extends DisassemblyPart implements IViewPart {
protected void fillLocalPullDown(IMenuManager manager) {
manager.add(fGlobalActions.get(ActionFactory.FIND.getId()));
- manager.add(new Separator("group.goto")); // ICommonMenuConstants.GROUP_GOTO //$NON-NLS-1$
+ manager.add(new Separator("group.goto")); // ICommonMenuConstants.GROUP_GOTO //$NON-NLS-1$
manager.add(fActionGotoPC);
manager.add(fActionGotoAddress);
- manager.add(new Separator("group.show")); // ICommonMenuConstants.GROUP_SHOW //$NON-NLS-1$
- manager.add(fSyncAction);
+ manager.add(new Separator("group.show")); // ICommonMenuConstants.GROUP_SHOW //$NON-NLS-1$
+ manager.add(fSyncAction);
manager.add(fTrackExpressionAction);
- manager.add(new Separator(ITextEditorActionConstants.GROUP_SETTINGS));
- manager.add(fActionToggleSource);
- manager.add(fActionToggleSymbols);
- manager.add(fActionOpenPreferences);
- // Other plug-ins can contribute their actions here
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ manager.add(new Separator(ITextEditorActionConstants.GROUP_SETTINGS));
+ manager.add(fActionToggleSource);
+ manager.add(fActionToggleSymbols);
+ manager.add(fActionOpenPreferences);
+ // Other plug-ins can contribute their actions here
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
@Override
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyViewerConfiguration.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyViewerConfiguration.java
index 6d67cd94002..dbbf0ac7ffa 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyViewerConfiguration.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyViewerConfiguration.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -55,8 +55,8 @@ public class DisassemblyViewerConfiguration extends TextSourceViewerConfiguratio
*/
@Override
public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent e, boolean documentPartitioningChanged) {
- int start= e.fOffset;
- int end= e.getOffset() + (e.getText() == null ? 0 : e.getText().length());
+ int start = e.fOffset;
+ int end = e.getOffset() + (e.getText() == null ? 0 : e.getText().length());
return new Region(start, end - start);
}
@@ -71,7 +71,7 @@ public class DisassemblyViewerConfiguration extends TextSourceViewerConfiguratio
}
/**
- *
+ *
*/
public DisassemblyViewerConfiguration(DisassemblyPart part) {
super(EditorsUI.getPreferenceStore());
@@ -89,6 +89,7 @@ public class DisassemblyViewerConfiguration extends TextSourceViewerConfiguratio
reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
return reconciler;
}
+
/*
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getUndoManager(org.eclipse.jface.text.source.ISourceViewer)
*/
@@ -97,7 +98,7 @@ public class DisassemblyViewerConfiguration extends TextSourceViewerConfiguratio
// no undo/redo
return null;
}
-
+
/*
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getTextHover(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
*/
@@ -111,21 +112,21 @@ public class DisassemblyViewerConfiguration extends TextSourceViewerConfiguratio
*/
@Override
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
- IHyperlinkDetector[] inheritedDetectors= super.getHyperlinkDetectors(sourceViewer);
-
+ IHyperlinkDetector[] inheritedDetectors = super.getHyperlinkDetectors(sourceViewer);
+
if (fPart == null || inheritedDetectors == null)
return inheritedDetectors;
-
- int inheritedDetectorsLength= inheritedDetectors.length;
- IHyperlinkDetector[] detectors= new IHyperlinkDetector[inheritedDetectorsLength + 1];
- detectors[0]= new DisassemblyHyperlinkDetector(fPart);
- for (int i= 0; i < inheritedDetectorsLength; i++) {
- detectors[i+1]= inheritedDetectors[i];
+
+ int inheritedDetectorsLength = inheritedDetectors.length;
+ IHyperlinkDetector[] detectors = new IHyperlinkDetector[inheritedDetectorsLength + 1];
+ detectors[0] = new DisassemblyHyperlinkDetector(fPart);
+ for (int i = 0; i < inheritedDetectorsLength; i++) {
+ detectors[i + 1] = inheritedDetectors[i];
}
-
+
return detectors;
}
-
+
/*
* @see org.eclipse.ui.editors.text.TextSourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer)
*/
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/EditionFinderJob.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/EditionFinderJob.java
index b40825d01d8..8874640a7d3 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/EditionFinderJob.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/EditionFinderJob.java
@@ -40,7 +40,7 @@ class EditionFinderJob extends Job {
/**
* Create a new edition finder for a file resource and address.
- *
+ *
* @param sourceInfo the file info containing the file resource for which to find an edition
* @param address address inside the module
* @param disassemblyPart the disassembly part where this job originated from
@@ -49,13 +49,13 @@ class EditionFinderJob extends Job {
super(DisassemblyMessages.EditionFinderJob_name);
Assert.isNotNull(sourceInfo);
Assert.isLegal(sourceInfo.fFile instanceof IFile);
- fSourceInfo= sourceInfo;
- fFile = (IFile)sourceInfo.fFile;
+ fSourceInfo = sourceInfo;
+ fFile = (IFile) sourceInfo.fFile;
fAddress = address;
- fDisassemblyPart= disassemblyPart;
+ fDisassemblyPart = disassemblyPart;
setRule(fFile);
setSystem(true);
- sourceInfo.fEditionJob= this;
+ sourceInfo.fEditionJob = this;
}
/*
@@ -79,7 +79,7 @@ class EditionFinderJob extends Job {
}
monitor.worked(1);
if (token instanceof Long && !monitor.isCanceled()) {
- moduleTime = ((Long)token).longValue();
+ moduleTime = ((Long) token).longValue();
long buildTime = moduleTime * 1000;
if (fFile.getLocalTimeStamp() > buildTime) {
monitor.subTask(DisassemblyMessages.EditionFinderJob_task_search_history);
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/FunctionOffsetRulerColumn.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/FunctionOffsetRulerColumn.java
index 9fac702c37e..1e314e637a3 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/FunctionOffsetRulerColumn.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/FunctionOffsetRulerColumn.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -29,7 +29,7 @@ public class FunctionOffsetRulerColumn extends DisassemblyRulerColumn {
public static final String ID = "org.eclipse.cdt.dsf.ui.disassemblyColumn.functionOffset"; //$NON-NLS-1$
/** Maximum width of column (in characters) */
- private static final int MAXWIDTH= 20;
+ private static final int MAXWIDTH = 20;
/**
* Default constructor.
@@ -44,13 +44,13 @@ public class FunctionOffsetRulerColumn extends DisassemblyRulerColumn {
*/
@Override
protected String createDisplayString(int line) {
- DisassemblyDocument doc = (DisassemblyDocument)getParentRuler().getTextViewer().getDocument();
+ DisassemblyDocument doc = (DisassemblyDocument) getParentRuler().getTextViewer().getDocument();
int offset;
try {
offset = doc.getLineOffset(line);
AddressRangePosition pos = doc.getDisassemblyPosition(offset);
if (pos instanceof DisassemblyPosition && pos.length > 0 && pos.offset == offset && pos.fValid) {
- DisassemblyPosition disassPos = (DisassemblyPosition)pos;
+ DisassemblyPosition disassPos = (DisassemblyPosition) pos;
int length = disassPos.fFunction.length;
if (length > MAXWIDTH) {
return "..." + new String(disassPos.fFunction, length - MAXWIDTH + 3, MAXWIDTH - 3); //$NON-NLS-1$
@@ -67,13 +67,13 @@ public class FunctionOffsetRulerColumn extends DisassemblyRulerColumn {
@Override
protected int computeNumberOfCharacters() {
- DisassemblyDocument doc = (DisassemblyDocument)getParentRuler().getTextViewer().getDocument();
+ DisassemblyDocument doc = (DisassemblyDocument) getParentRuler().getTextViewer().getDocument();
return Math.min(MAXWIDTH, doc.getMaxFunctionLength());
}
@Override
public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
+ String property = event.getProperty();
boolean needRedraw = false;
if (DisassemblyPreferenceConstants.FUNCTION_OFFSETS_COLOR.equals(property)) {
setForeground(getColor(property));
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/IDisassemblyHelpContextIds.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/IDisassemblyHelpContextIds.java
index bffe1ec3058..92be62b550d 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/IDisassemblyHelpContextIds.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/IDisassemblyHelpContextIds.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java
index d95cca8ebf0..a62c300e2d2 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java
@@ -30,7 +30,7 @@ public class OpcodeRulerColumn extends DisassemblyRulerColumn {
public static final String ID = "org.eclipse.cdt.dsf.ui.disassemblyColumn.opcode"; //$NON-NLS-1$
/** Maximum width of column (in characters) */
- private static final int MAXWIDTH= 20;
+ private static final int MAXWIDTH = 20;
private int fRadix;
private String fRadixPrefix;
@@ -45,7 +45,7 @@ public class OpcodeRulerColumn extends DisassemblyRulerColumn {
}
public void setRadix(int radix) {
- fRadix= radix;
+ fRadix = radix;
setShowRadixPrefix();
}
@@ -66,26 +66,26 @@ public class OpcodeRulerColumn extends DisassemblyRulerColumn {
protected String createDisplayString(int line) {
int nChars = computeNumberOfCharacters();
if (nChars > 0) {
- DisassemblyDocument doc = (DisassemblyDocument)getParentRuler().getTextViewer().getDocument();
+ DisassemblyDocument doc = (DisassemblyDocument) getParentRuler().getTextViewer().getDocument();
try {
int offset = doc.getLineOffset(line);
AddressRangePosition pos = doc.getDisassemblyPosition(offset);
if (pos instanceof DisassemblyPosition && pos.length > 0 && pos.offset == offset && pos.fValid) {
- DisassemblyPosition disassPos = (DisassemblyPosition)pos;
+ DisassemblyPosition disassPos = (DisassemblyPosition) pos;
if (disassPos.fOpcodes != null) {
// Format the output.
String str = disassPos.fOpcodes.toString(fRadix);
int prefixLength = 0;
-
+
if (fRadixPrefix != null)
prefixLength = fRadixPrefix.length();
-
+
StringBuilder buf = new StringBuilder(nChars);
-
+
if (prefixLength != 0)
buf.append(fRadixPrefix);
-
- for (int i=str.length()+prefixLength; i < nChars; ++i)
+
+ for (int i = str.length() + prefixLength; i < nChars; ++i)
buf.append('0');
buf.append(str);
if (buf.length() > nChars)
@@ -104,13 +104,13 @@ public class OpcodeRulerColumn extends DisassemblyRulerColumn {
@Override
protected int computeNumberOfCharacters() {
- DisassemblyDocument doc = (DisassemblyDocument)getParentRuler().getTextViewer().getDocument();
+ DisassemblyDocument doc = (DisassemblyDocument) getParentRuler().getTextViewer().getDocument();
return Math.min(MAXWIDTH, doc.getMaxOpcodeLength(fRadix));
}
@Override
public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
+ String property = event.getProperty();
IPreferenceStore store = getPreferenceStore();
boolean needRedraw = false;
if (DisassemblyPreferenceConstants.CODE_BYTES_COLOR.equals(property)) {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourceColorerJob.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourceColorerJob.java
index 5e99d800703..e523f2412cc 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourceColorerJob.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourceColorerJob.java
@@ -36,9 +36,9 @@ class SourceColorerJob extends UIJob implements Runnable {
public SourceColorerJob(Display jobDisplay, IStorage storage, DisassemblyPart disassemblyPart) {
super(DisassemblyMessages.SourceColorerJob_name);
- fDisassemblyPart= disassemblyPart;
- fViewer= disassemblyPart.getTextViewer();
- fDocument= (DisassemblyDocument) fViewer.getDocument();
+ fDisassemblyPart = disassemblyPart;
+ fViewer = disassemblyPart.getTextViewer();
+ fDocument = (DisassemblyDocument) fViewer.getDocument();
fStorage = storage;
setDisplay(fDisassemblyPart.getSite().getShell().getDisplay());
setSystem(true);
@@ -56,7 +56,7 @@ class SourceColorerJob extends UIJob implements Runnable {
if (fi != null) {
fi.initPresentationCreator(fViewer);
if (fi.fError != null) {
- String message= DisassemblyMessages.Disassembly_log_error_readFile + fi.fFileKey;
+ String message = DisassemblyMessages.Disassembly_log_error_readFile + fi.fFileKey;
fDisassemblyPart.logWarning(message, fi.fError);
}
}
@@ -71,8 +71,9 @@ class SourceColorerJob extends UIJob implements Runnable {
*/
@Override
public void run() {
- IWorkbenchSiteProgressService progressService = fDisassemblyPart.getSite().getAdapter(IWorkbenchSiteProgressService.class);
- if(progressService != null) {
+ IWorkbenchSiteProgressService progressService = fDisassemblyPart.getSite()
+ .getAdapter(IWorkbenchSiteProgressService.class);
+ if (progressService != null) {
progressService.schedule(this, 0, true);
} else {
schedule();
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourcePosition.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourcePosition.java
index ba5eb30f818..289ba9d4508 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourcePosition.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/SourcePosition.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -27,20 +27,22 @@ public class SourcePosition extends AddressRangePosition {
public int fLine;
public int fLast = -1;
- public SourcePosition(int offset, int length, BigInteger addressOffset, SourceFileInfo fileInfo, int line, int last) {
+ public SourcePosition(int offset, int length, BigInteger addressOffset, SourceFileInfo fileInfo, int line,
+ int last) {
this(offset, length, addressOffset, fileInfo, line, last, true);
}
- public SourcePosition(int offset, int length, BigInteger addressOffset, SourceFileInfo fileInfo, int line, int last, boolean valid) {
+ public SourcePosition(int offset, int length, BigInteger addressOffset, SourceFileInfo fileInfo, int line, int last,
+ boolean valid) {
super(offset, length, addressOffset, BigInteger.ZERO, valid);
fFileInfo = fileInfo;
fLine = line;
fLast = last;
}
-
+
@Override
public String toString() {
- return super.toString() + "->["+fFileInfo.fFileKey + ':' + fLine + ']'; //$NON-NLS-1$
+ return super.toString() + "->[" + fFileInfo.fFileKey + ':' + fLine + ']'; //$NON-NLS-1$
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java
index 4f3b8afa23b..5c92c047226 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyAction.java
@@ -28,18 +28,18 @@ public abstract class AbstractDisassemblyAction extends Action implements IUpdat
/**
* Create a disassembly action.
- *
+ *
* @param disassemblyPart
*/
public AbstractDisassemblyAction(IDisassemblyPart disassemblyPart) {
Assert.isLegal(disassemblyPart != null);
- fDisassemblyPart= disassemblyPart;
+ fDisassemblyPart = disassemblyPart;
fDisassemblyPart.addPropertyListener(this);
}
/**
* Create a disassembly action.
- *
+ *
* @param disassemblyPart
* @param style
* one of <code>AS_PUSH_BUTTON</code>,
@@ -50,18 +50,17 @@ public abstract class AbstractDisassemblyAction extends Action implements IUpdat
public AbstractDisassemblyAction(IDisassemblyPart disassemblyPart, int style) {
super(null, style);
Assert.isLegal(disassemblyPart != null);
- fDisassemblyPart= disassemblyPart;
+ fDisassemblyPart = disassemblyPart;
fDisassemblyPart.addPropertyListener(this);
}
-
/**
* @return the disassembly part
*/
public final IDisassemblyPart getDisassemblyPart() {
return fDisassemblyPart;
}
-
+
/*
* @see org.eclipse.jface.action.Action#run()
*/
@@ -70,10 +69,10 @@ public abstract class AbstractDisassemblyAction extends Action implements IUpdat
@Override
public void update() {
- boolean enabled= fDisassemblyPart == null || fDisassemblyPart.isConnected();
+ boolean enabled = fDisassemblyPart == null || fDisassemblyPart.isConnected();
setEnabled(enabled);
}
-
+
/*
* @see org.eclipse.ui.IPropertyListener#propertyChanged(java.lang.Object, int)
*/
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyBreakpointRulerAction.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyBreakpointRulerAction.java
index fb961ef9428..63764b6526e 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyBreakpointRulerAction.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyBreakpointRulerAction.java
@@ -34,7 +34,7 @@ public abstract class AbstractDisassemblyBreakpointRulerAction extends AbstractD
/**
* Create breakpoint ruler action.
- *
+ *
* @param disassemblyPart
* @param rulerInfo
*/
@@ -45,7 +45,7 @@ public abstract class AbstractDisassemblyBreakpointRulerAction extends AbstractD
/**
* Returns the breakpoint at the last line of mouse activity in the ruler
* or <code>null</code> if none.
- *
+ *
* @return breakpoint associated with activity in the ruler or <code>null</code>
*/
protected IBreakpoint getBreakpoint() {
@@ -63,7 +63,8 @@ public abstract class AbstractDisassemblyBreakpointRulerAction extends AbstractD
Position position = annotationModel.getPosition(markerAnnotation);
int line = document.getLineOfOffset(position.getOffset());
if (line == getRulerInfo().getLineOfLastMouseButtonActivity()) {
- IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);
+ IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager()
+ .getBreakpoint(marker);
if (breakpoint != null) {
return breakpoint;
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerAction.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerAction.java
index f7d1ece3f7b..0de7b3881de 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerAction.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerAction.java
@@ -26,18 +26,18 @@ public abstract class AbstractDisassemblyRulerAction extends AbstractDisassembly
private final IVerticalRulerInfo fRulerInfo;
protected AbstractDisassemblyRulerAction(IDisassemblyPart disassemblyPart, IVerticalRulerInfo rulerInfo) {
- fDisassemblyPart= disassemblyPart;
- fRulerInfo= rulerInfo;
+ fDisassemblyPart = disassemblyPart;
+ fRulerInfo = rulerInfo;
}
-
+
public final IVerticalRulerInfo getRulerInfo() {
return fRulerInfo;
}
-
+
public final IDocument getDocument() {
return getDisassemblyPart().getTextViewer().getDocument();
}
-
+
public final IAnnotationModel getAnnotationModel() {
return getDisassemblyPart().getTextViewer().getAnnotationModel();
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerActionDelegate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerActionDelegate.java
index 48f2ece4c62..555cf32b4b6 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerActionDelegate.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AbstractDisassemblyRulerActionDelegate.java
@@ -39,10 +39,11 @@ import org.eclipse.ui.texteditor.IUpdate;
* adapter (inner) action on menu and mouse action on the vertical ruler.<p>
* Extending classes must implement the factory method
* <code>createAction(IDisassemblyPart, IVerticalRulerInfo)</code>.
- *
+ *
* @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate
*/
-public abstract class AbstractDisassemblyRulerActionDelegate extends ActionDelegate implements IEditorActionDelegate, IViewActionDelegate, MouseListener, IMenuListener {
+public abstract class AbstractDisassemblyRulerActionDelegate extends ActionDelegate
+ implements IEditorActionDelegate, IViewActionDelegate, MouseListener, IMenuListener {
/** The disassembly part. */
private IDisassemblyPart fDisassemblyPart;
@@ -68,24 +69,24 @@ public abstract class AbstractDisassemblyRulerActionDelegate extends ActionDeleg
setTargetPart(callerAction, targetEditor);
}
- /*
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- @Override
+ /*
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ @Override
public void init(IViewPart view) {
- setTargetPart(fCallerAction, view);
- }
+ setTargetPart(fCallerAction, view);
+ }
@Override
public void init(IAction action) {
- fCallerAction= action;
+ fCallerAction = action;
}
private void setTargetPart(IAction callerAction, IWorkbenchPart targetPart) {
if (fDisassemblyPart != null) {
- IVerticalRulerInfo rulerInfo= fDisassemblyPart.getAdapter(IVerticalRulerInfo.class);
+ IVerticalRulerInfo rulerInfo = fDisassemblyPart.getAdapter(IVerticalRulerInfo.class);
if (rulerInfo != null) {
- Control control= rulerInfo.getControl();
+ Control control = rulerInfo.getControl();
if (control != null && !control.isDisposed())
control.removeMouseListener(this);
}
@@ -93,19 +94,19 @@ public abstract class AbstractDisassemblyRulerActionDelegate extends ActionDeleg
fDisassemblyPart.removeRulerContextMenuListener(this);
}
- fDisassemblyPart= targetPart == null ? null : targetPart.getAdapter(IDisassemblyPart.class);
- fCallerAction= callerAction;
- fAction= null;
+ fDisassemblyPart = targetPart == null ? null : targetPart.getAdapter(IDisassemblyPart.class);
+ fCallerAction = callerAction;
+ fAction = null;
if (fDisassemblyPart != null) {
- fDisassemblyPart.addRulerContextMenuListener(this);
+ fDisassemblyPart.addRulerContextMenuListener(this);
- IVerticalRulerInfo rulerInfo= fDisassemblyPart.getAdapter(IVerticalRulerInfo.class);
+ IVerticalRulerInfo rulerInfo = fDisassemblyPart.getAdapter(IVerticalRulerInfo.class);
if (rulerInfo != null) {
- fAction= createAction(fDisassemblyPart, rulerInfo);
+ fAction = createAction(fDisassemblyPart, rulerInfo);
update();
- Control control= rulerInfo.getControl();
+ Control control = rulerInfo.getControl();
if (control != null && !control.isDisposed())
control.addMouseListener(this);
}
@@ -117,7 +118,7 @@ public abstract class AbstractDisassemblyRulerActionDelegate extends ActionDeleg
if (fAction != null)
fAction.run();
}
-
+
@Override
public void runWithEvent(IAction action, Event event) {
if (fAction != null)
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoAddress.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoAddress.java
index a4355d04870..109e89a7328 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoAddress.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoAddress.java
@@ -30,10 +30,11 @@ public final class ActionGotoAddress extends AbstractDisassemblyAction {
super(disassemblyPart);
setText(DisassemblyMessages.Disassembly_action_GotoAddress_label);
}
+
@Override
public void run() {
ITextViewer viewer = getDisassemblyPart().getTextViewer();
- IDocument document= viewer.getDocument();
+ IDocument document = viewer.getDocument();
IRegion wordRegion = CWordFinder.findWord(document, viewer.getSelectedRange().x);
String defaultValue = null;
if (wordRegion != null) {
@@ -51,7 +52,7 @@ public final class ActionGotoAddress extends AbstractDisassemblyAction {
}
String dlgTitle = DisassemblyMessages.Disassembly_GotoAddressDialog_title;
String dlgLabel = DisassemblyMessages.Disassembly_GotoAddressDialog_label;
- final Shell shell= getDisassemblyPart().getSite().getShell();
+ final Shell shell = getDisassemblyPart().getSite().getShell();
InputDialog dlg = new InputDialog(shell, dlgTitle, dlgLabel, defaultValue, null);
if (dlg.open() == IDialogConstants.OK_ID) {
String value = dlg.getValue();
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoProgramCounter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoProgramCounter.java
index f68f962e63f..096653e0c92 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoProgramCounter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionGotoProgramCounter.java
@@ -22,6 +22,7 @@ public final class ActionGotoProgramCounter extends AbstractDisassemblyAction {
setText(DisassemblyMessages.Disassembly_action_GotoPC_label);
setToolTipText(DisassemblyMessages.Disassembly_action_GotoPC_tooltip);
}
+
@Override
public void run() {
getDisassemblyPart().gotoProgramCounter();
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionOpenPreferences.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionOpenPreferences.java
index 6c98ba02274..018c7af3825 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionOpenPreferences.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/ActionOpenPreferences.java
@@ -21,10 +21,12 @@ import org.eclipse.ui.dialogs.PreferencesUtil;
public final class ActionOpenPreferences extends Action {
private final static String PREF_PAGE_ID = "org.eclipse.cdt.dsf.debug.ui.disassembly.preferencePage"; //$NON-NLS-1$
private final Shell fShell;
+
public ActionOpenPreferences(Shell shell) {
- fShell= shell;
+ fShell = shell;
setText(DisassemblyMessages.Disassembly_action_OpenPreferences_label);
}
+
@Override
public void run() {
PreferencesUtil.createPreferenceDialogOn(fShell, PREF_PAGE_ID, new String[] { PREF_PAGE_ID }, null).open();
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddBreakpointRulerAction.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddBreakpointRulerAction.java
index 3b6c35879db..989b352005b 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddBreakpointRulerAction.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddBreakpointRulerAction.java
@@ -41,101 +41,98 @@ import org.eclipse.ui.IWorkbenchPart;
* Ruler action to add breakpoint with a dialog properties.
*/
public class AddBreakpointRulerAction extends AbstractDisassemblyBreakpointRulerAction {
-
-
+
protected AddBreakpointRulerAction(IDisassemblyPart disassemblyPart, IVerticalRulerInfo rulerInfo) {
super(disassemblyPart, rulerInfo);
- setText(DisassemblyMessages.Disassembly_action_AddBreakpoint_label + "\t" + //$NON-NLS-1$
- CDebugUIUtils.formatKeyBindingString(SWT.MOD1, DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
+ setText(DisassemblyMessages.Disassembly_action_AddBreakpoint_label + "\t" + //$NON-NLS-1$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD1,
+ DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
}
-
+
/*
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.actions.AbstractDisassemblyAction#run()
*/
@Override
public void run() {
- IWorkbenchPart part = getDisassemblyPart();
- ISelection selection = getSelection();
- IToggleBreakpointsTargetCExtension toggleTarget = getToggleTarget(selection);
- if (toggleTarget != null) {
- try {
- if (toggleTarget.canCreateLineBreakpointsInteractive(part, selection)) {
- toggleTarget.createLineBreakpointsInteractive(part, selection);
- }
- } catch (CoreException e) {
- reportException(e);
- }
- }
+ IWorkbenchPart part = getDisassemblyPart();
+ ISelection selection = getSelection();
+ IToggleBreakpointsTargetCExtension toggleTarget = getToggleTarget(selection);
+ if (toggleTarget != null) {
+ try {
+ if (toggleTarget.canCreateLineBreakpointsInteractive(part, selection)) {
+ toggleTarget.createLineBreakpointsInteractive(part, selection);
+ }
+ } catch (CoreException e) {
+ reportException(e);
+ }
+ }
}
@Override
public void update() {
- IDisassemblyPart part = getDisassemblyPart();
- if (part != null && part.isConnected()) {
- ISelection selection = getSelection();
- IToggleBreakpointsTargetCExtension toggleTarget = getToggleTarget(selection);
- if (toggleTarget != null) {
- setEnabled( toggleTarget.canCreateLineBreakpointsInteractive(part, selection) );
- return;
- }
- }
- setEnabled(false);
+ IDisassemblyPart part = getDisassemblyPart();
+ if (part != null && part.isConnected()) {
+ ISelection selection = getSelection();
+ IToggleBreakpointsTargetCExtension toggleTarget = getToggleTarget(selection);
+ if (toggleTarget != null) {
+ setEnabled(toggleTarget.canCreateLineBreakpointsInteractive(part, selection));
+ return;
+ }
+ }
+ setEnabled(false);
}
-
+
private IToggleBreakpointsTargetCExtension getToggleTarget(ISelection selection) {
- IToggleBreakpointsTargetManager toggleMgr = DebugUITools.getToggleBreakpointsTargetManager();
- IToggleBreakpointsTarget toggleTarget = toggleMgr.getToggleBreakpointsTarget(getDisassemblyPart(), selection);
- if (toggleTarget instanceof IToggleBreakpointsTargetCExtension) {
- return (IToggleBreakpointsTargetCExtension)toggleTarget;
- }
- return null;
+ IToggleBreakpointsTargetManager toggleMgr = DebugUITools.getToggleBreakpointsTargetManager();
+ IToggleBreakpointsTarget toggleTarget = toggleMgr.getToggleBreakpointsTarget(getDisassemblyPart(), selection);
+ if (toggleTarget instanceof IToggleBreakpointsTargetCExtension) {
+ return (IToggleBreakpointsTargetCExtension) toggleTarget;
+ }
+ return null;
}
- /**
- * Report an error to the user.
- *
- * @param e underlying exception
- */
- private void reportException(Exception e) {
- IStatus status= new Status(IStatus.ERROR, CDebugUIPlugin.PLUGIN_ID, "Error creating breakpoint: ", e); //$NON-NLS-1$
- ErrorDialog.openError(
- getDisassemblyPart().getSite().getShell(),
- DisassemblyMessages.Disassembly_action_AddBreakpoint_errorTitle,
- DisassemblyMessages.Disassembly_action_AddBreakpoint_errorMessage,
- status);
- CDebugUIPlugin.log(status);
- }
+ /**
+ * Report an error to the user.
+ *
+ * @param e underlying exception
+ */
+ private void reportException(Exception e) {
+ IStatus status = new Status(IStatus.ERROR, CDebugUIPlugin.PLUGIN_ID, "Error creating breakpoint: ", e); //$NON-NLS-1$
+ ErrorDialog.openError(getDisassemblyPart().getSite().getShell(),
+ DisassemblyMessages.Disassembly_action_AddBreakpoint_errorTitle,
+ DisassemblyMessages.Disassembly_action_AddBreakpoint_errorMessage, status);
+ CDebugUIPlugin.log(status);
+ }
/**
- * Determines the text selection for the breakpoint action. If clicking on the ruler inside
- * the highlighted text, return the text selection for the highlighted text. Otherwise,
- * return a text selection representing the start of the line.
- *
- * @return An ISelection as described.
- * @throws BadLocationException If underlying operations throw.
- */
- private ISelection getSelection() {
- IDocument document = getDocument();
- if (document != null) {
- int line = getRulerInfo().getLineOfLastMouseButtonActivity();
-
- try {
- IRegion region = getDocument().getLineInformation(line);
- ITextSelection textSelection = new TextSelection(document, region.getOffset(), 0);
- ISelectionProvider provider = getDisassemblyPart().getSite().getSelectionProvider();
- if (provider != null){
- ISelection selection = provider.getSelection();
- if (selection instanceof ITextSelection
- && ((ITextSelection) selection).getStartLine() <= line
- && ((ITextSelection) selection).getEndLine() >= line) {
- textSelection = (ITextSelection) selection;
- }
- }
- return textSelection;
- } catch (BadLocationException e) {
- }
- }
- return StructuredSelection.EMPTY;
- }
+ * Determines the text selection for the breakpoint action. If clicking on the ruler inside
+ * the highlighted text, return the text selection for the highlighted text. Otherwise,
+ * return a text selection representing the start of the line.
+ *
+ * @return An ISelection as described.
+ * @throws BadLocationException If underlying operations throw.
+ */
+ private ISelection getSelection() {
+ IDocument document = getDocument();
+ if (document != null) {
+ int line = getRulerInfo().getLineOfLastMouseButtonActivity();
+
+ try {
+ IRegion region = getDocument().getLineInformation(line);
+ ITextSelection textSelection = new TextSelection(document, region.getOffset(), 0);
+ ISelectionProvider provider = getDisassemblyPart().getSite().getSelectionProvider();
+ if (provider != null) {
+ ISelection selection = provider.getSelection();
+ if (selection instanceof ITextSelection && ((ITextSelection) selection).getStartLine() <= line
+ && ((ITextSelection) selection).getEndLine() >= line) {
+ textSelection = (ITextSelection) selection;
+ }
+ }
+ return textSelection;
+ } catch (BadLocationException e) {
+ }
+ }
+ return StructuredSelection.EMPTY;
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddressBarContributionItem.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddressBarContributionItem.java
index ec3d9c2a739..62659c39ac3 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddressBarContributionItem.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/AddressBarContributionItem.java
@@ -57,7 +57,7 @@ public class AddressBarContributionItem extends ContributionItem {
/**
* Use this constructor to create an AddressBarContributionItem.
- *
+ *
* @param action
* a contribution action.
*/
@@ -68,7 +68,7 @@ public class AddressBarContributionItem extends ContributionItem {
/**
* After constructing this object, call this method to create an address
* box.
- *
+ *
* @param parent
* a ToolBar object. Can be obtain with the getControl() method
* in the ToolBarManager class.
@@ -81,8 +81,7 @@ public class AddressBarContributionItem extends ContributionItem {
* the tooltip of the warning label if it ever becomes visible.
* May be null.
*/
- public void createAddressBox(ToolBar parent, int width, String initialText,
- String warningText) {
+ public void createAddressBox(ToolBar parent, int width, String initialText, String warningText) {
this.width = width;
this.initialText = initialText;
this.lastText = initialText;
@@ -108,8 +107,8 @@ public class AddressBarContributionItem extends ContributionItem {
Control box = internalCreateAddressBox(parent);
item.setControl(box);
item.setWidth(width);
-
- enableAddressBox(action.isEnabled());
+
+ enableAddressBox(action.isEnabled());
}
/**
@@ -122,7 +121,7 @@ public class AddressBarContributionItem extends ContributionItem {
/**
* Get the address bar text
- *
+ *
* @return The text in the address bar.
*/
public String getText() {
@@ -135,7 +134,7 @@ public class AddressBarContributionItem extends ContributionItem {
/**
* Set the visibility of the warning icon. Should be set to true when there
* is a problem jumping to the specified address; false otherwise
- *
+ *
* @param visible
* True for visible, false for hidden.
*/
@@ -147,7 +146,7 @@ public class AddressBarContributionItem extends ContributionItem {
/**
* Return whether the warning icon is visible or not.
- *
+ *
* @return True if visible, otherwise false.
*/
public boolean isWarningIconVisible() {
@@ -158,7 +157,7 @@ public class AddressBarContributionItem extends ContributionItem {
/**
* Enable the address combo box.
- *
+ *
* @param enable
* true to enable, else false.
*/
@@ -171,7 +170,7 @@ public class AddressBarContributionItem extends ContributionItem {
/**
* Creates the combo box and add it to the toolbar.
- *
+ *
* @param parent
* the parent, toolbar.
* @return the combo box address control.
@@ -186,9 +185,8 @@ public class AddressBarContributionItem extends ContributionItem {
warningLabel = new Label(top, SWT.NONE);
- warningImage = AbstractUIPlugin
- .imageDescriptorFromPlugin(
- DsfUIPlugin.PLUGIN_ID, "icons/address_warning.gif").createImage(); //$NON-NLS-1$
+ warningImage = AbstractUIPlugin.imageDescriptorFromPlugin(DsfUIPlugin.PLUGIN_ID, "icons/address_warning.gif") //$NON-NLS-1$
+ .createImage();
warningLabel.setImage(warningImage);
warningLabel.setToolTipText(warningText);
setWarningIconVisible(false);
@@ -209,27 +207,21 @@ public class AddressBarContributionItem extends ContributionItem {
@Override
public void keyReleased(KeyEvent e) {
- if (e.stateMask == SWT.CTRL
- && (((char) e.keyCode) == 'c' || ((char) e.keyCode) == 'C')) {
+ if (e.stateMask == SWT.CTRL && (((char) e.keyCode) == 'c' || ((char) e.keyCode) == 'C')) {
String selection = null;
Point selectionPoint = addressBox.getSelection();
if (selectionPoint.x == selectionPoint.y)
return;
- selection = addressBox.getText().substring(
- selectionPoint.x, selectionPoint.y);
+ selection = addressBox.getText().substring(selectionPoint.x, selectionPoint.y);
- if ((selection != null)
- && (!(selection.trim().length() == 0))) {
+ if ((selection != null) && (!(selection.trim().length() == 0))) {
Clipboard clipboard = null;
try {
- clipboard = new Clipboard(addressBox
- .getDisplay());
- clipboard.setContents(
- new Object[] { selection },
- new Transfer[] { TextTransfer
- .getInstance() });
+ clipboard = new Clipboard(addressBox.getDisplay());
+ clipboard.setContents(new Object[] { selection },
+ new Transfer[] { TextTransfer.getInstance() });
} finally {
if (clipboard != null)
clipboard.dispose();
@@ -243,12 +235,12 @@ public class AddressBarContributionItem extends ContributionItem {
@Override
public void focusGained(FocusEvent e) {
// [nmehregani] bugzilla 297387: 'Home' shouldn't jump to PC address when focus is on location combo box
- if (action instanceof JumpToAddressAction)
- ((JumpToAddressAction)action).deactivateDisassemblyContext();
+ if (action instanceof JumpToAddressAction)
+ ((JumpToAddressAction) action).deactivateDisassemblyContext();
// end 297387
-
+
lastText = addressBox.getText();
-
+
// Erase the guide text when the focus is gained.
if (lastText.trim().equals(initialText))
addressBox.setText(""); //$NON-NLS-1$
@@ -260,10 +252,10 @@ public class AddressBarContributionItem extends ContributionItem {
@Override
public void focusLost(FocusEvent e) {
// [nmehregani] bugzilla 297387: 'Home' shouldn't jump to PC address when focus is on location combo box
- if (action instanceof JumpToAddressAction)
- ((JumpToAddressAction)action).activateDisassemblyContext();
+ if (action instanceof JumpToAddressAction)
+ ((JumpToAddressAction) action).activateDisassemblyContext();
// end 297387
-
+
// Re-insert the last text when the focus is lost and the text
// field is empty.
if (addressBox.getText().trim().length() == 0)
@@ -298,8 +290,7 @@ public class AddressBarContributionItem extends ContributionItem {
}
}
- if ((!bExist) && (addressBox.getText() != null)
- && (!(addressBox.getText().trim().length() == 0)))
+ if ((!bExist) && (addressBox.getText() != null) && (!(addressBox.getText().trim().length() == 0)))
addressBox.add(addressBox.getText());
}
}
@@ -319,8 +310,7 @@ public class AddressBarContributionItem extends ContributionItem {
}
});
- addressBox.setLayoutData(new GridData(GridData.FILL,
- GridData.BEGINNING, true, false));
+ addressBox.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
return top;
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/BreakpointPropertiesRulerAction.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/BreakpointPropertiesRulerAction.java
index 3add572606b..b56893ec7a7 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/BreakpointPropertiesRulerAction.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/BreakpointPropertiesRulerAction.java
@@ -34,48 +34,64 @@ import org.eclipse.ui.IWorkbenchPart;
* Ruler action to display breakpoint properties.
*/
public class BreakpointPropertiesRulerAction extends AbstractDisassemblyBreakpointRulerAction {
-
-
+
private ICBreakpoint fBreakpoint;
protected BreakpointPropertiesRulerAction(IDisassemblyPart disassemblyPart, IVerticalRulerInfo rulerInfo) {
super(disassemblyPart, rulerInfo);
- setText(DisassemblyMessages.Disassembly_action_BreakpointProperties_label + "\t" + //$NON-NLS-1$
- CDebugUIUtils.formatKeyBindingString(SWT.MOD1, DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
+ setText(DisassemblyMessages.Disassembly_action_BreakpointProperties_label + "\t" + //$NON-NLS-1$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD1,
+ DisassemblyMessages.Disassembly_action_ToggleBreakpoint_accelerator));
}
-
+
/*
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.actions.AbstractDisassemblyAction#run()
*/
@Override
public void run() {
- if ( fBreakpoint != null ) {
- final ISelection debugContext = getDebugContext();
-
- CBreakpointPropertyDialogAction propertiesAction = new CBreakpointPropertyDialogAction(
- getDisassemblyPart().getSite(),
- new ISelectionProvider() {
- @Override
- public ISelection getSelection() {
- return new StructuredSelection( fBreakpoint );
- }
- @Override public void addSelectionChangedListener( ISelectionChangedListener listener ) {}
- @Override public void removeSelectionChangedListener( ISelectionChangedListener listener ) {}
- @Override public void setSelection( ISelection selection ) {}
- },
- new IDebugContextProvider() {
- @Override
- public ISelection getActiveContext() {
- return debugContext;
- }
- @Override public void addDebugContextListener(IDebugContextListener listener) {}
- @Override public void removeDebugContextListener(IDebugContextListener listener) {}
- @Override public IWorkbenchPart getPart() { return null; }
-
- }
- );
- propertiesAction.run();
- propertiesAction.dispose();
+ if (fBreakpoint != null) {
+ final ISelection debugContext = getDebugContext();
+
+ CBreakpointPropertyDialogAction propertiesAction = new CBreakpointPropertyDialogAction(
+ getDisassemblyPart().getSite(), new ISelectionProvider() {
+ @Override
+ public ISelection getSelection() {
+ return new StructuredSelection(fBreakpoint);
+ }
+
+ @Override
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+
+ @Override
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ }
+
+ @Override
+ public void setSelection(ISelection selection) {
+ }
+ }, new IDebugContextProvider() {
+ @Override
+ public ISelection getActiveContext() {
+ return debugContext;
+ }
+
+ @Override
+ public void addDebugContextListener(IDebugContextListener listener) {
+ }
+
+ @Override
+ public void removeDebugContextListener(IDebugContextListener listener) {
+ }
+
+ @Override
+ public IWorkbenchPart getPart() {
+ return null;
+ }
+
+ });
+ propertiesAction.run();
+ propertiesAction.dispose();
}
}
@@ -84,18 +100,19 @@ public class BreakpointPropertiesRulerAction extends AbstractDisassemblyBreakpoi
*/
@Override
public void update() {
- IBreakpoint breakpoint= getBreakpoint();
-
- if (breakpoint instanceof ICBreakpoint) {
- fBreakpoint = (ICBreakpoint)breakpoint;
- } else {
- fBreakpoint = null;
- }
- setEnabled( fBreakpoint != null );
+ IBreakpoint breakpoint = getBreakpoint();
+
+ if (breakpoint instanceof ICBreakpoint) {
+ fBreakpoint = (ICBreakpoint) breakpoint;
+ } else {
+ fBreakpoint = null;
+ }
+ setEnabled(fBreakpoint != null);
}
-
+
private ISelection getDebugContext() {
- return DebugUITools.getDebugContextManager().getContextService(getDisassemblyPart().getSite().getWorkbenchWindow()).getActiveContext();
+ return DebugUITools.getDebugContextManager()
+ .getContextService(getDisassemblyPart().getSite().getWorkbenchWindow()).getActiveContext();
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/JumpToAddressAction.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/JumpToAddressAction.java
index 376a7adedad..c878e5e0a9e 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/JumpToAddressAction.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/JumpToAddressAction.java
@@ -25,41 +25,41 @@ import org.eclipse.jface.action.Action;
public class JumpToAddressAction extends Action {
DisassemblyPart fDisassemblyPart = null;
-
+
public JumpToAddressAction(DisassemblyPart disassemblyPart) {
fDisassemblyPart = disassemblyPart;
}
-
+
@Override
- public void run() {
+ public void run() {
AddressBarContributionItem addressBar = fDisassemblyPart.getAddressBar();
- if (addressBar!=null && addressBar.isEnabled() && fDisassemblyPart.isSuspended()) {
- String locationTxt = addressBar.getText();
-
- if (locationTxt==null || locationTxt.trim().length()==0)
- return;
-
- locationTxt = locationTxt.trim();
-
- if (locationTxt.equals(DisassemblyMessages.Disassembly_GotoLocation_initial_text)) {
- fDisassemblyPart.gotoActiveFrameByUser();
- return;
- }
+ if (addressBar != null && addressBar.isEnabled() && fDisassemblyPart.isSuspended()) {
+ String locationTxt = addressBar.getText();
+
+ if (locationTxt == null || locationTxt.trim().length() == 0)
+ return;
+
+ locationTxt = locationTxt.trim();
- BigInteger address = fDisassemblyPart.eval(locationTxt, false);
+ if (locationTxt.equals(DisassemblyMessages.Disassembly_GotoLocation_initial_text)) {
+ fDisassemblyPart.gotoActiveFrameByUser();
+ return;
+ }
+
+ BigInteger address = fDisassemblyPart.eval(locationTxt, false);
if (address.compareTo(BigInteger.ZERO) < 0) {
addressBar.setWarningIconVisible(true);
- } else {
+ } else {
fDisassemblyPart.gotoLocationByUser(address, locationTxt);
addressBar.setWarningIconVisible(false);
}
- }
+ }
}
-
+
protected void activateDisassemblyContext() {
- fDisassemblyPart.activateDisassemblyContext();
+ fDisassemblyPart.activateDisassemblyContext();
}
-
+
protected void deactivateDisassemblyContext() {
fDisassemblyPart.deactivateDisassemblyContext();
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointActionDelegate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointActionDelegate.java
index 6de5b847e9b..6874ffbe364 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointActionDelegate.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointActionDelegate.java
@@ -22,7 +22,7 @@ import org.eclipse.jface.text.source.IVerticalRulerInfo;
* Ruler toggle breakpoint action delegate for disassembly parts.
*
* @since 2.1
- *
+ *
* @see org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate
*/
public class RulerToggleBreakpointActionDelegate extends AbstractDisassemblyRulerActionDelegate {
@@ -37,7 +37,8 @@ public class RulerToggleBreakpointActionDelegate extends AbstractDisassemblyRule
if (fDelegate != null) {
fDelegate.dispose();
}
- return fDelegate = new ToggleBreakpointAction(disassemblyPart, disassemblyPart.getTextViewer().getDocument(), rulerInfo);
+ return fDelegate = new ToggleBreakpointAction(disassemblyPart, disassemblyPart.getTextViewer().getDocument(),
+ rulerInfo);
}
/*
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointHandler.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointHandler.java
index b6dffe9b653..b57218784e2 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointHandler.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/RulerToggleBreakpointHandler.java
@@ -27,7 +27,7 @@ import org.eclipse.ui.handlers.HandlerUtil;
/**
* Default handler for the toggle breakpoint command in the disassembly ruler.
* Invoked on double click in the ruler.
- *
+ *
* @since 2.1
*/
public class RulerToggleBreakpointHandler extends AbstractHandler {
@@ -38,20 +38,20 @@ public class RulerToggleBreakpointHandler extends AbstractHandler {
if (part instanceof IDisassemblyPart) {
IDisassemblyPart disassemblyPart = (IDisassemblyPart) part;
IDocument document = disassemblyPart.getTextViewer().getDocument();
- final IVerticalRulerInfo rulerInfo= part.getAdapter(IVerticalRulerInfo.class);
+ final IVerticalRulerInfo rulerInfo = part.getAdapter(IVerticalRulerInfo.class);
if (rulerInfo != null) {
- final ToggleBreakpointAction toggleBpAction= new ToggleBreakpointAction(part, document, rulerInfo);
+ final ToggleBreakpointAction toggleBpAction = new ToggleBreakpointAction(part, document, rulerInfo);
try {
toggleBpAction.update();
if (toggleBpAction.isEnabled()) {
- if (event.getTrigger() instanceof Event) {
- // Pass through the event that triggered the action.
- // This will give toggle action access to key modifiers
- // (shift, ctrl, etc.)
- toggleBpAction.runWithEvent((Event)event.getTrigger());
- } else {
- toggleBpAction.run();
- }
+ if (event.getTrigger() instanceof Event) {
+ // Pass through the event that triggered the action.
+ // This will give toggle action access to key modifiers
+ // (shift, ctrl, etc.)
+ toggleBpAction.runWithEvent((Event) event.getTrigger());
+ } else {
+ toggleBpAction.run();
+ }
}
} finally {
toggleBpAction.dispose();
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/TextOperationAction.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/TextOperationAction.java
index ed34714299e..7ec162af4e0 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/TextOperationAction.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/actions/TextOperationAction.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -22,41 +22,42 @@ import org.eclipse.ui.texteditor.IUpdate;
* TextOperationAction
*/
public class TextOperationAction extends Action implements IUpdate {
-
- private int fOperationCode= -1;
- private ITextOperationTarget fOperationTarget;
-
- public TextOperationAction(ITextViewer viewer, int operationCode) {
- fOperationCode= operationCode;
- fOperationTarget= viewer.getTextOperationTarget();
- update();
- }
-
- /**
- * Updates the enabled state of the action.
- * Fires a property change if the enabled state changes.
- *
- * @see Action#firePropertyChange(String, Object, Object)
- */
- @Override
- public void update() {
-
- boolean wasEnabled= isEnabled();
- boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode));
- setEnabled(isEnabled);
-
- if (wasEnabled != isEnabled) {
- firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE);
- }
+
+ private int fOperationCode = -1;
+ private ITextOperationTarget fOperationTarget;
+
+ public TextOperationAction(ITextViewer viewer, int operationCode) {
+ fOperationCode = operationCode;
+ fOperationTarget = viewer.getTextOperationTarget();
+ update();
+ }
+
+ /**
+ * Updates the enabled state of the action.
+ * Fires a property change if the enabled state changes.
+ *
+ * @see Action#firePropertyChange(String, Object, Object)
+ */
+ @Override
+ public void update() {
+
+ boolean wasEnabled = isEnabled();
+ boolean isEnabled = (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode));
+ setEnabled(isEnabled);
+
+ if (wasEnabled != isEnabled) {
+ firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE,
+ isEnabled ? Boolean.TRUE : Boolean.FALSE);
}
-
- /**
- * @see Action#run()
- */
- @Override
- public void run() {
- if (fOperationCode != -1 && fOperationTarget != null) {
- fOperationTarget.doOperation(fOperationCode);
- }
+ }
+
+ /**
+ * @see Action#run()
+ */
+ @Override
+ public void run() {
+ if (fOperationCode != -1 && fOperationTarget != null) {
+ fOperationTarget.doOperation(fOperationCode);
}
}
+}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/Addr2Line.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/Addr2Line.java
index 3a47d09b619..92148529438 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/Addr2Line.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/Addr2Line.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
@@ -15,14 +15,13 @@ package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.model;
import java.math.BigInteger;
-
public class Addr2Line {
- public BigInteger addr;
- public Addr2Line next;
- public int first;
- public int last;
-
- public static int hash(BigInteger addr, int size) {
- return (int)((addr.shiftRight(2).longValue()) % size);
- }
+ public BigInteger addr;
+ public Addr2Line next;
+ public int first;
+ public int last;
+
+ public static int hash(BigInteger addr, int size) {
+ return (int) ((addr.shiftRight(2).longValue()) % size);
+ }
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java
index f39a55a3595..d4e56201573 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java
@@ -49,20 +49,21 @@ import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
* Annotation model for breakpoints in the disassembly.
* Works only with {@link DisassemblyDocument}.
*/
-public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel implements IBreakpointListener, IDocumentListener {
-
+public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel
+ implements IBreakpointListener, IDocumentListener {
+
private Runnable fCatchup;
private IAdaptable fDebugContext;
-
+
public BreakpointsAnnotationModel(IAdaptable debugContext) {
fDebugContext = debugContext;
}
-
+
@Override
public void connect(IDocument document) {
super.connect(document);
if (document instanceof DisassemblyDocument) {
- final IBreakpointManager bpMgr= DebugPlugin.getDefault().getBreakpointManager();
+ final IBreakpointManager bpMgr = DebugPlugin.getDefault().getBreakpointManager();
addBreakpoints(bpMgr.getBreakpoints());
bpMgr.addBreakpointListener(this);
document.addDocumentListener(this);
@@ -72,17 +73,17 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
@Override
public void disconnect(IDocument document) {
if (document instanceof DisassemblyDocument) {
- final IBreakpointManager bpMgr= DebugPlugin.getDefault().getBreakpointManager();
+ final IBreakpointManager bpMgr = DebugPlugin.getDefault().getBreakpointManager();
bpMgr.removeBreakpointListener(this);
document.removeDocumentListener(this);
- fCatchup= null;
+ fCatchup = null;
}
super.disconnect(document);
}
private void catchupWithBreakpoints() {
removeAllAnnotations(false);
- final IBreakpointManager bpMgr= DebugPlugin.getDefault().getBreakpointManager();
+ final IBreakpointManager bpMgr = DebugPlugin.getDefault().getBreakpointManager();
addBreakpoints(bpMgr.getBreakpoints());
}
@@ -106,10 +107,10 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
*/
@Override
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
- Annotation a= findAnnotation(breakpoint.getMarker());
+ Annotation a = findAnnotation(breakpoint.getMarker());
if (a != null) {
if (a instanceof SimpleMarkerAnnotation) {
- ((SimpleMarkerAnnotation)a).update();
+ ((SimpleMarkerAnnotation) a).update();
}
synchronized (getLockObject()) {
getAnnotationModelEvent().annotationChanged(a);
@@ -125,15 +126,15 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
*/
@Override
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
- Annotation a= findAnnotation(breakpoint.getMarker());
+ Annotation a = findAnnotation(breakpoint.getMarker());
if (a != null) {
removeAnnotation(a, true);
}
}
private Annotation findAnnotation(IMarker marker) {
- for (Iterator<Annotation> it= getAnnotationIterator(false); it.hasNext();) {
- SimpleMarkerAnnotation a= (SimpleMarkerAnnotation) it.next();
+ for (Iterator<Annotation> it = getAnnotationIterator(false); it.hasNext();) {
+ SimpleMarkerAnnotation a = (SimpleMarkerAnnotation) it.next();
if (a.getMarker().equals(marker)) {
return a;
}
@@ -145,7 +146,7 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
if (fDocument == null) {
return;
}
- final IMarker marker= breakpoint.getMarker();
+ final IMarker marker = breakpoint.getMarker();
if (marker == null) {
return;
}
@@ -160,10 +161,10 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
// ignore wrong positions
}
}
-
+
private Position createPositionFromBreakpoint(IBreakpoint breakpoint) throws CoreException {
IBreakpointLocationProvider locationProvider = breakpoint.getAdapter(IBreakpointLocationProvider.class);
-
+
/* if there is a location provider, than use the provider to retrieve the location */
if (locationProvider != null) {
@@ -172,20 +173,20 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
if (sourceFile != null) {
int lineNumber = locationProvider.getLineNumber(breakpoint, fDebugContext) - 1;
return createPositionFromSourceLine(sourceFile, lineNumber);
-
+
} else {
/* if there is label info, than create a label position */
IAddress labelAddress = locationProvider.getLabelAddress(breakpoint, fDebugContext);
if (labelAddress != null) {
return createPositionFromLabel(labelAddress.getValue());
-
- /* Otherwise, create an address position */
+
+ /* Otherwise, create an address position */
} else {
// See bug 300053 comment 5:
- // Since there can only be one annotation per marker and in order to support multiple
+ // Since there can only be one annotation per marker and in order to support multiple
// annotations per breakpoint, we need a specialized annotation type.
//
- // So for now, we only create an annotation for the first valid address. We can add
+ // So for now, we only create an annotation for the first valid address. We can add
// support for multiple annotations per breakpoint when it's needed.
IAddress[] addresses = locationProvider.getAddresses(breakpoint, fDebugContext);
for (int i = 0; addresses != null && i < addresses.length; ++i) {
@@ -196,31 +197,31 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
}
}
}
-
- /* otherwise, use legacy ICBreakpoint location info */
+
+ /* otherwise, use legacy ICBreakpoint location info */
} else {
if (breakpoint instanceof ICAddressBreakpoint) {
- ICAddressBreakpoint addressBreakpoint= (ICAddressBreakpoint) breakpoint;
+ ICAddressBreakpoint addressBreakpoint = (ICAddressBreakpoint) breakpoint;
return createPositionFromAddress(decodeAddress(addressBreakpoint.getAddress()));
} else if (breakpoint instanceof ILineBreakpoint) {
- ILineBreakpoint lineBreakpoint= (ILineBreakpoint) breakpoint;
- Position position= null;
- final int lineNumber= lineBreakpoint.getLineNumber() - 1;
- final IMarker marker= breakpoint.getMarker();
+ ILineBreakpoint lineBreakpoint = (ILineBreakpoint) breakpoint;
+ Position position = null;
+ final int lineNumber = lineBreakpoint.getLineNumber() - 1;
+ final IMarker marker = breakpoint.getMarker();
if (marker.getResource().getType() == IResource.FILE) {
- position= createPositionFromSourceLine((IFile) marker.getResource(), lineNumber);
+ position = createPositionFromSourceLine((IFile) marker.getResource(), lineNumber);
if (position != null) {
return position;
}
}
- String fileName= marker.getAttribute(ICLineBreakpoint.SOURCE_HANDLE, null);
- position= createPositionFromSourceLine(fileName, lineNumber);
+ String fileName = marker.getAttribute(ICLineBreakpoint.SOURCE_HANDLE, null);
+ position = createPositionFromSourceLine(fileName, lineNumber);
if (position == null && breakpoint instanceof ICLineBreakpoint) {
- ICLineBreakpoint cBreakpoint= (ICLineBreakpoint) breakpoint;
+ ICLineBreakpoint cBreakpoint = (ICLineBreakpoint) breakpoint;
if (breakpoint instanceof ICFunctionBreakpoint) {
- position= createPositionFromLabel(cBreakpoint.getFunction());
+ position = createPositionFromLabel(cBreakpoint.getFunction());
} else {
- position= createPositionFromAddress(decodeAddress(cBreakpoint.getAddress()));
+ position = createPositionFromAddress(decodeAddress(cBreakpoint.getAddress()));
}
}
return position;
@@ -232,7 +233,7 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
/**
* Decode given string representation of a non-negative integer. A
* hexadecimal encoded integer is expected to start with <code>0x</code>.
- *
+ *
* @param string
* decimal or hexadecimal representation of an non-negative integer
* @return address value as <code>BigInteger</code> or <code>null</code> in case of a <code>NumberFormatException</code>
@@ -266,14 +267,15 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple
@Override
public void documentChanged(DocumentEvent event) {
if (fCatchup == null && event.fText != null && !event.fText.isEmpty()) {
- fCatchup= new Runnable() {
+ fCatchup = new Runnable() {
@Override
public void run() {
if (fCatchup == this) {
catchupWithBreakpoints();
- fCatchup= null;
+ fCatchup = null;
}
- }};
+ }
+ };
Display.getCurrent().timerExec(50, fCatchup);
}
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java
index f6d6376bdca..ce851ee11c9 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* Patrick Chuong (Texas Instruments) - Bug 315443
@@ -69,7 +69,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
* manipulate the list. This list should be accessed only from the GUI thread
*/
private final List<SourcePosition> fInvalidSource = new ArrayList<SourcePosition>();
-
+
private final Map<IStorage, SourceFileInfo> fFileInfoMap = new HashMap<IStorage, SourceFileInfo>();
private int fMaxFunctionLength = 0;
@@ -116,7 +116,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
assert isGuiThread();
super.dispose();
-
+
// cleanup source info
for (Iterator<SourceFileInfo> iter = fFileInfoMap.values().iterator(); iter.hasNext();) {
SourceFileInfo fi = iter.next();
@@ -136,7 +136,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
setLineTracker(new DefaultLineTracker());
completeInitialization();
}
-
+
public AddressRangePosition[] getInvalidAddressRanges() {
assert isGuiThread();
return fInvalidAddressRanges.toArray(new AddressRangePosition[fInvalidAddressRanges.size()]);
@@ -150,35 +150,35 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
return fMaxFunctionLength;
}
- public void setMaxOpcodeLength(BigInteger longOpcode ) {
+ public void setMaxOpcodeLength(BigInteger longOpcode) {
fMaxOpcodeLength = longOpcode;
}
- public int getMaxOpcodeLength(int radix ) {
+ public int getMaxOpcodeLength(int radix) {
int retVal = 0;
if (fMaxOpcodeLength != null) {
String str = fMaxOpcodeLength.toString(radix);
retVal = str.length();
switch (radix) {
- case 8:
- retVal += 1; // Padded for 0 prefix
- break;
- case 16:
- retVal += 2; // Padded for 0x prefix
- break;
- default:
- break;
+ case 8:
+ retVal += 1; // Padded for 0 prefix
+ break;
+ case 16:
+ retVal += 2; // Padded for 0x prefix
+ break;
+ default:
+ break;
}
}
return retVal;
}
public int getAddressLength() {
- return fNumberOfDigits+2;
+ return fNumberOfDigits + 2;
}
public int getMeanSizeOfInstructions() {
- return (int)(fMeanSizeOfInstructions+.9);
+ return (int) (fMeanSizeOfInstructions + .9);
}
public Iterator<Position> getModelPositionIterator(BigInteger address) {
@@ -199,7 +199,8 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
return positions.listIterator(idx);
}
- public Iterator<Position> getPositionIterator(String category, BigInteger address) throws BadPositionCategoryException {
+ public Iterator<Position> getPositionIterator(String category, BigInteger address)
+ throws BadPositionCategoryException {
List<Position> positions = getDocumentManagedPositions().get(category);
if (positions == null) {
throw new BadPositionCategoryException();
@@ -220,11 +221,11 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
* Computes the index in the list of positions at which a position with the
* given address would be inserted. The position is supposed to become the
* first in this list of all positions with the same offset.
- *
+ *
* @param positions the list in which the index is computed
* @param address the address for which the index is computed
* @return the computed index
- *
+ *
*/
protected int computeIndexInPositionListFirst(List<Position> positions, BigInteger address) {
int size = positions.size();
@@ -236,7 +237,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
int mid = 0;
while (low < hi