Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorMikhail Khodjaiants2008-04-09 13:51:38 +0000
committerMikhail Khodjaiants2008-04-09 13:51:38 +0000
commit887a1ea83e60effe5d785cc3c13a67c8a7fa6b6c (patch)
treef26172f6dd0ebcc84cbc7b5689efc69a16aacdd2 /debug
parente9ac88667a8bbac361fa66e05b1217f18ffaee56 (diff)
downloadorg.eclipse.cdt-887a1ea83e60effe5d785cc3c13a67c8a7fa6b6c.tar.gz
org.eclipse.cdt-887a1ea83e60effe5d785cc3c13a67c8a7fa6b6c.tar.xz
org.eclipse.cdt-887a1ea83e60effe5d785cc3c13a67c8a7fa6b6c.zip
Added support for breakpoint actions to the disassembly editor.
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java43
1 files changed, 22 insertions, 21 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java
index 741f6718b5..9b59a3f851 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java
@@ -73,7 +73,28 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
*/
public void toggleLineBreakpoints( IWorkbenchPart part, ISelection selection ) throws CoreException {
String errorMessage = null;
- if ( part instanceof ITextEditor ) {
+ // Check for DisassemblyEditor first because it implements ITextEditor
+ if ( part instanceof DisassemblyEditor && selection instanceof ITextSelection ) {
+ DisassemblyEditor editor = (DisassemblyEditor)part;
+ int lineNumber = ((ITextSelection)selection).getStartLine();
+ if ( lineNumber != -1 ) {
+ IEditorInput input = editor.getEditorInput();
+ if ( input != null ) {
+ VirtualDocument document = (VirtualDocument)editor.getDocumentProvider().getDocument( input );
+ if ( document != null ) {
+ IPresentationContext presentationContext = document.getPresentationContext();
+ Object element = document.getElementAtLine( lineNumber );
+ if ( element != null ) {
+ IElementToggleBreakpointAdapter adapter = getToggleBreakpointAdapter( element );
+ if ( adapter != null ) {
+ adapter.toggleLineBreakpoints( presentationContext, element );
+ }
+ }
+ }
+ }
+ }
+ }
+ else if ( part instanceof ITextEditor ) {
ITextEditor textEditor = (ITextEditor)part;
IEditorInput input = textEditor.getEditorInput();
if ( input == null ) {
@@ -156,26 +177,6 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
}
}
}
- else if ( part instanceof DisassemblyEditor && selection instanceof ITextSelection ) {
- DisassemblyEditor editor = (DisassemblyEditor)part;
- int lineNumber = ((ITextSelection)selection).getStartLine();
- if ( lineNumber != -1 ) {
- IEditorInput input = editor.getEditorInput();
- if ( input != null ) {
- VirtualDocument document = (VirtualDocument)editor.getDocumentProvider().getDocument( input );
- if ( document != null ) {
- IPresentationContext presentationContext = document.getPresentationContext();
- Object element = document.getElementAtLine( lineNumber );
- if ( element != null ) {
- IElementToggleBreakpointAdapter adapter = getToggleBreakpointAdapter( element );
- if ( adapter != null ) {
- adapter.toggleLineBreakpoints( presentationContext, element );
- }
- }
- }
- }
- }
- }
else {
errorMessage = ActionMessages.getString( "RunToLineAdapter.Operation_is_not_supported_1" ); //$NON-NLS-1$
}

Back to the top