mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Implementing the Disassembly view. New annotation model is added to show breakpoint markers.
This commit is contained in:
parent
d2db6b3af9
commit
07dc15fa9c
6 changed files with 140 additions and 82 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2004-04-15 Mikhail Khodjaiants
|
||||||
|
Implementing the Disassembly view.
|
||||||
|
New annotation model is added to show breakpoint markers.
|
||||||
|
* DisassemblyDocumentProvider.java
|
||||||
|
* DisassemblyEditorInput.java
|
||||||
|
* DisassemblyInstructionPointerAnnotation.java
|
||||||
|
* DisassemblyMarkerAnnotationModel.java: new
|
||||||
|
* DisassemblyView.java
|
||||||
|
|
||||||
2004-04-19 Mikhail Khodjaiants
|
2004-04-19 Mikhail Khodjaiants
|
||||||
Fix for bug 58711: Breakpoint race condition.
|
Fix for bug 58711: Breakpoint race condition.
|
||||||
To avoid race condition all breakpoint marker updates (like increment/decrement the install count,
|
To avoid race condition all breakpoint marker updates (like increment/decrement the install count,
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
|
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
|
||||||
|
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.jface.text.Document;
|
import org.eclipse.jface.text.Document;
|
||||||
|
@ -18,8 +17,6 @@ import org.eclipse.jface.text.IDocument;
|
||||||
import org.eclipse.jface.text.source.IAnnotationModel;
|
import org.eclipse.jface.text.source.IAnnotationModel;
|
||||||
import org.eclipse.ui.texteditor.IDocumentProvider;
|
import org.eclipse.ui.texteditor.IDocumentProvider;
|
||||||
import org.eclipse.ui.texteditor.IElementStateListener;
|
import org.eclipse.ui.texteditor.IElementStateListener;
|
||||||
import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Document provider for disassembly view.
|
* Document provider for disassembly view.
|
||||||
|
@ -28,7 +25,7 @@ public class DisassemblyDocumentProvider implements IDocumentProvider {
|
||||||
|
|
||||||
private IDocument fDocument;
|
private IDocument fDocument;
|
||||||
|
|
||||||
private IAnnotationModel fAnnotationModel;
|
private DisassemblyMarkerAnnotationModel fAnnotationModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for DisassemblyDocumentProvider.
|
* Constructor for DisassemblyDocumentProvider.
|
||||||
|
@ -40,17 +37,12 @@ public class DisassemblyDocumentProvider implements IDocumentProvider {
|
||||||
* @see org.eclipse.ui.texteditor.IDocumentProvider#connect(java.lang.Object)
|
* @see org.eclipse.ui.texteditor.IDocumentProvider#connect(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public void connect( Object element ) throws CoreException {
|
public void connect( Object element ) throws CoreException {
|
||||||
if ( element instanceof IDocument ) {
|
|
||||||
IAnnotationModel model = getAnnotationModel( null );
|
|
||||||
model.connect( (IDocument)element );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.texteditor.IDocumentProvider#disconnect(java.lang.Object)
|
* @see org.eclipse.ui.texteditor.IDocumentProvider#disconnect(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public void disconnect( Object element ) {
|
public void disconnect( Object element ) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -59,12 +51,13 @@ public class DisassemblyDocumentProvider implements IDocumentProvider {
|
||||||
public IDocument getDocument( Object element ) {
|
public IDocument getDocument( Object element ) {
|
||||||
if ( fDocument == null ) {
|
if ( fDocument == null ) {
|
||||||
fDocument = new Document();
|
fDocument = new Document();
|
||||||
try {
|
|
||||||
connect( fDocument );
|
|
||||||
}
|
}
|
||||||
catch( CoreException e ) {
|
if ( element instanceof DisassemblyEditorInput ) {
|
||||||
fDocument = null;
|
String contents = ((DisassemblyEditorInput)element).getContents();
|
||||||
|
fDocument.set( contents );
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
fDocument.set( "" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return fDocument;
|
return fDocument;
|
||||||
}
|
}
|
||||||
|
@ -128,8 +121,9 @@ public class DisassemblyDocumentProvider implements IDocumentProvider {
|
||||||
*/
|
*/
|
||||||
public IAnnotationModel getAnnotationModel( Object element ) {
|
public IAnnotationModel getAnnotationModel( Object element ) {
|
||||||
if ( fAnnotationModel == null ) {
|
if ( fAnnotationModel == null ) {
|
||||||
fAnnotationModel = new ResourceMarkerAnnotationModel( ResourcesPlugin.getWorkspace().getRoot() );
|
fAnnotationModel = new DisassemblyMarkerAnnotationModel();
|
||||||
}
|
}
|
||||||
|
fAnnotationModel.setInput( ( element instanceof DisassemblyEditorInput ) ? (DisassemblyEditorInput)element : null );
|
||||||
return fAnnotationModel;
|
return fAnnotationModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,9 @@ import java.util.Arrays;
|
||||||
import org.eclipse.cdt.debug.core.model.IAsmInstruction;
|
import org.eclipse.cdt.debug.core.model.IAsmInstruction;
|
||||||
import org.eclipse.cdt.debug.core.model.ICStackFrame;
|
import org.eclipse.cdt.debug.core.model.ICStackFrame;
|
||||||
import org.eclipse.cdt.debug.core.model.IDisassembly;
|
import org.eclipse.cdt.debug.core.model.IDisassembly;
|
||||||
|
import org.eclipse.cdt.debug.core.model.IExecFileInfo;
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
|
import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
|
||||||
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.ui.IEditorInput;
|
import org.eclipse.ui.IEditorInput;
|
||||||
import org.eclipse.ui.IPersistableElement;
|
import org.eclipse.ui.IPersistableElement;
|
||||||
|
@ -58,6 +60,18 @@ public class DisassemblyEditorInput implements IEditorInput {
|
||||||
return (address >= fStartAddress && address <= fEndAddress);
|
return (address >= fStartAddress && address <= fEndAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IFile getModuleFile() {
|
||||||
|
IDisassembly d = getDisassembly();
|
||||||
|
IFile result = null;
|
||||||
|
if ( d != null ) {
|
||||||
|
IExecFileInfo info = (IExecFileInfo)d.getAdapter( IExecFileInfo.class );
|
||||||
|
if ( info != null ) {
|
||||||
|
result = info.getExecFile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private void createContent() {
|
private void createContent() {
|
||||||
StringBuffer lines = new StringBuffer();
|
StringBuffer lines = new StringBuffer();
|
||||||
int maxFunctionName = 0;
|
int maxFunctionName = 0;
|
||||||
|
@ -227,4 +241,8 @@ public class DisassemblyEditorInput implements IEditorInput {
|
||||||
public long getAddress( int lineNumber ) throws IllegalArgumentException {
|
public long getAddress( int lineNumber ) throws IllegalArgumentException {
|
||||||
return ( fStorage != null ) ? fStorage.getAddress( lineNumber ) : 0;
|
return ( fStorage != null ) ? fStorage.getAddress( lineNumber ) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IFile getModuleFile() {
|
||||||
|
return ( fStorage != null ) ? fStorage.getModuleFile() : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,11 +24,7 @@ import org.eclipse.jface.text.source.Annotation;
|
||||||
*/
|
*/
|
||||||
public class DisassemblyInstructionPointerAnnotation extends Annotation {
|
public class DisassemblyInstructionPointerAnnotation extends Annotation {
|
||||||
|
|
||||||
/**
|
private int fHashCode = 0;
|
||||||
* The frame for this instruction pointer annotation. This is necessary only so that
|
|
||||||
* instances of this class can be distinguished by equals().
|
|
||||||
*/
|
|
||||||
private ICStackFrame fStackFrame;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct an instruction pointer annotation for the given stack frame.
|
* Construct an instruction pointer annotation for the given stack frame.
|
||||||
|
@ -40,16 +36,7 @@ public class DisassemblyInstructionPointerAnnotation extends Annotation {
|
||||||
super( isTopFrame ? IInternalCDebugUIConstants.ANN_DISASM_INSTR_POINTER_CURRENT : IInternalCDebugUIConstants.ANN_DISASM_INSTR_POINTER_SECONDARY,
|
super( isTopFrame ? IInternalCDebugUIConstants.ANN_DISASM_INSTR_POINTER_CURRENT : IInternalCDebugUIConstants.ANN_DISASM_INSTR_POINTER_SECONDARY,
|
||||||
false,
|
false,
|
||||||
isTopFrame ? DisassemblyMessages.getString( "DisassemblyInstructionPointerAnnotation.Current_Pointer_1" ) : DisassemblyMessages.getString( "DisassemblyInstructionPointerAnnotation.Secondary_Pointer_1" ) ); //$NON-NLS-1$ //$NON-NLS-2$
|
isTopFrame ? DisassemblyMessages.getString( "DisassemblyInstructionPointerAnnotation.Current_Pointer_1" ) : DisassemblyMessages.getString( "DisassemblyInstructionPointerAnnotation.Secondary_Pointer_1" ) ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
fStackFrame = stackFrame;
|
fHashCode = getHashCode( stackFrame );
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the stack frame associated with this annotation
|
|
||||||
*
|
|
||||||
* @return the stack frame associated with this annotation
|
|
||||||
*/
|
|
||||||
public ICStackFrame getStackFrame() {
|
|
||||||
return fStackFrame;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private IDisassembly getDisassembly( ICStackFrame frame ) {
|
private IDisassembly getDisassembly( ICStackFrame frame ) {
|
||||||
|
@ -64,28 +51,15 @@ public class DisassemblyInstructionPointerAnnotation extends Annotation {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
public boolean equals( Object other ) {
|
|
||||||
if ( other instanceof DisassemblyInstructionPointerAnnotation ) {
|
|
||||||
ICStackFrame otherFrame = ((DisassemblyInstructionPointerAnnotation)other).getStackFrame();
|
|
||||||
IDisassembly otherDisassembly = getDisassembly( otherFrame );
|
|
||||||
if ( otherDisassembly != null && otherDisassembly.equals( getDisassembly( getStackFrame() ) ) ) {
|
|
||||||
return ( otherFrame.getAddress() == getStackFrame().getAddress() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#hashCode()
|
* @see java.lang.Object#hashCode()
|
||||||
*/
|
*/
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
return fHashCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getHashCode( ICStackFrame frame ) {
|
||||||
int hashCode = 17;
|
int hashCode = 17;
|
||||||
ICStackFrame frame = getStackFrame();
|
|
||||||
IDisassembly disassembly = getDisassembly( frame );
|
IDisassembly disassembly = getDisassembly( frame );
|
||||||
hashCode = 37*hashCode + (( disassembly != null ) ? disassembly.hashCode() : 0);
|
hashCode = 37*hashCode + (( disassembly != null ) ? disassembly.hashCode() : 0);
|
||||||
if ( frame != null ) {
|
if ( frame != null ) {
|
||||||
|
@ -94,4 +68,11 @@ public class DisassemblyInstructionPointerAnnotation extends Annotation {
|
||||||
}
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see java.lang.Object#equals(java.lang.Object)
|
||||||
|
*/
|
||||||
|
public boolean equals( Object obj ) {
|
||||||
|
return ( obj != null ? obj.hashCode() == hashCode() : false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IMarker;
|
||||||
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.jface.text.Position;
|
||||||
|
import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marker annotation model for disassembly.
|
||||||
|
*/
|
||||||
|
public class DisassemblyMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
|
||||||
|
|
||||||
|
private DisassemblyEditorInput fInput;
|
||||||
|
|
||||||
|
public DisassemblyMarkerAnnotationModel() {
|
||||||
|
super( ResourcesPlugin.getWorkspace().getRoot() );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected DisassemblyEditorInput getInput() {
|
||||||
|
return this.fInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setInput( DisassemblyEditorInput input ) {
|
||||||
|
this.fInput = input;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#deleteMarkers(org.eclipse.core.resources.IMarker[])
|
||||||
|
*/
|
||||||
|
protected void deleteMarkers( IMarker[] markers ) throws CoreException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
super.deleteMarkers( markers );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#isAcceptable(org.eclipse.core.resources.IMarker)
|
||||||
|
*/
|
||||||
|
protected boolean isAcceptable( IMarker marker ) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return super.isAcceptable( marker );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#retrieveMarkers()
|
||||||
|
*/
|
||||||
|
protected IMarker[] retrieveMarkers() throws CoreException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return super.retrieveMarkers();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel#createPositionFromMarker(org.eclipse.core.resources.IMarker)
|
||||||
|
*/
|
||||||
|
protected Position createPositionFromMarker( IMarker marker ) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return super.createPositionFromMarker( marker );
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,7 +32,6 @@ import org.eclipse.jface.action.IToolBarManager;
|
||||||
import org.eclipse.jface.action.Separator;
|
import org.eclipse.jface.action.Separator;
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
import org.eclipse.jface.text.BadLocationException;
|
import org.eclipse.jface.text.BadLocationException;
|
||||||
import org.eclipse.jface.text.IDocument;
|
|
||||||
import org.eclipse.jface.text.IRegion;
|
import org.eclipse.jface.text.IRegion;
|
||||||
import org.eclipse.jface.text.Position;
|
import org.eclipse.jface.text.Position;
|
||||||
import org.eclipse.jface.text.source.IAnnotationAccess;
|
import org.eclipse.jface.text.source.IAnnotationAccess;
|
||||||
|
@ -42,6 +41,7 @@ import org.eclipse.jface.text.source.ISourceViewer;
|
||||||
import org.eclipse.jface.text.source.IVerticalRuler;
|
import org.eclipse.jface.text.source.IVerticalRuler;
|
||||||
import org.eclipse.jface.text.source.SourceViewer;
|
import org.eclipse.jface.text.source.SourceViewer;
|
||||||
import org.eclipse.jface.text.source.VerticalRuler;
|
import org.eclipse.jface.text.source.VerticalRuler;
|
||||||
|
import org.eclipse.jface.util.Assert;
|
||||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
|
@ -217,7 +217,8 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
|
||||||
* @return the vertical ruler
|
* @return the vertical ruler
|
||||||
*/
|
*/
|
||||||
private IVerticalRuler createVerticalRuler() {
|
private IVerticalRuler createVerticalRuler() {
|
||||||
return new VerticalRuler( VERTICAL_RULER_WIDTH, getAnnotationAccess() );
|
IVerticalRuler ruler = new VerticalRuler( VERTICAL_RULER_WIDTH, getAnnotationAccess() );
|
||||||
|
return ruler;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -283,12 +284,9 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
|
||||||
}
|
}
|
||||||
|
|
||||||
setInput( input );
|
setInput( input );
|
||||||
|
|
||||||
showViewer();
|
showViewer();
|
||||||
IDocument document = viewer.getDocument();
|
getSourceViewer().setDocument( getDocumentProvider().getDocument( input ),
|
||||||
String contents = ((DisassemblyEditorInput)input).getContents();
|
getDocumentProvider().getAnnotationModel( input ) );
|
||||||
document.set( contents );
|
|
||||||
|
|
||||||
updateObjects();
|
updateObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +393,7 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
|
||||||
getSourceViewer().setSelectedRange( start, 0 );
|
getSourceViewer().setSelectedRange( start, 0 );
|
||||||
}
|
}
|
||||||
widget.setRedraw( true );
|
widget.setRedraw( true );
|
||||||
setInstructionPointer( frame, start, length );
|
setInstructionPointer( frame, start, length, getDocumentProvider().getAnnotationModel( input ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,22 +494,15 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
|
||||||
return this.fDocumentProvider;
|
return this.fDocumentProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setInstructionPointer( ICStackFrame frame, int start, int length ) {
|
protected void setInstructionPointer( ICStackFrame frame, int start, int length, IAnnotationModel model ) {
|
||||||
|
Assert.isNotNull( model );
|
||||||
boolean tos = isTopStackFrame( frame );
|
boolean tos = isTopStackFrame( frame );
|
||||||
DisassemblyInstructionPointerAnnotation instPtrAnnotation = new DisassemblyInstructionPointerAnnotation( frame, tos );
|
DisassemblyInstructionPointerAnnotation instPtrAnnotation = new DisassemblyInstructionPointerAnnotation( frame, tos );
|
||||||
|
|
||||||
Position position = new Position( start, length );
|
Position position = new Position( start, length );
|
||||||
|
DisassemblyInstructionPointerAnnotation oldPointer = getCurrentInstructionPointer();
|
||||||
// Add the annotation at the position to the editor's annotation model.
|
if ( oldPointer != null )
|
||||||
// If there is no annotation model, there's nothing more to do
|
model.removeAnnotation( oldPointer );
|
||||||
IAnnotationModel annModel = getDocumentProvider().getAnnotationModel( null );
|
model.addAnnotation( instPtrAnnotation, position );
|
||||||
if ( annModel == null ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
DisassemblyInstructionPointerAnnotation currentPointer = getCurrentInstructionPointer();
|
|
||||||
if ( currentPointer != null )
|
|
||||||
removeCurrentInstructionPointer();
|
|
||||||
annModel.addAnnotation( instPtrAnnotation, position );
|
|
||||||
setCurrentInstructionPointer( instPtrAnnotation );
|
setCurrentInstructionPointer( instPtrAnnotation );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,16 +525,14 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
|
||||||
fInstrPointerAnnotation = instrPointer;
|
fInstrPointerAnnotation = instrPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void removeCurrentInstructionPointer() {
|
protected void removeCurrentInstructionPointer( IAnnotationModel model ) {
|
||||||
|
Assert.isNotNull( model );
|
||||||
DisassemblyInstructionPointerAnnotation instrPointer = getCurrentInstructionPointer();
|
DisassemblyInstructionPointerAnnotation instrPointer = getCurrentInstructionPointer();
|
||||||
if ( instrPointer != null ) {
|
if ( instrPointer != null ) {
|
||||||
IAnnotationModel annModel = getDocumentProvider().getAnnotationModel( null );
|
model.removeAnnotation( instrPointer );
|
||||||
if ( annModel != null ) {
|
|
||||||
annModel.removeAnnotation( instrPointer );
|
|
||||||
setCurrentInstructionPointer( null );
|
setCurrentInstructionPointer( null );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected void resetViewerInput() {
|
protected void resetViewerInput() {
|
||||||
SourceViewer viewer = getSourceViewer();
|
SourceViewer viewer = getSourceViewer();
|
||||||
|
@ -552,12 +541,10 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
|
||||||
|
|
||||||
IEditorInput input = DisassemblyEditorInput.EMPTY_EDITOR_INPUT;
|
IEditorInput input = DisassemblyEditorInput.EMPTY_EDITOR_INPUT;
|
||||||
setInput( input );
|
setInput( input );
|
||||||
|
|
||||||
showViewer();
|
showViewer();
|
||||||
IDocument document = getSourceViewer().getDocument();
|
IAnnotationModel model = getDocumentProvider().getAnnotationModel( input );
|
||||||
String contents = ((DisassemblyEditorInput)input).getContents();
|
getSourceViewer().setDocument( getDocumentProvider().getDocument( input ), model );
|
||||||
document.set( contents );
|
removeCurrentInstructionPointer( model );
|
||||||
removeCurrentInstructionPointer();
|
|
||||||
|
|
||||||
updateObjects();
|
updateObjects();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue