mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
Contributing new disassembly.
This commit is contained in:
parent
5b528871c9
commit
dac361c1c2
2 changed files with 31 additions and 7 deletions
|
@ -16,6 +16,7 @@ import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
|
||||||
import org.eclipse.cdt.debug.internal.ui.actions.CBreakpointPropertiesRulerAction;
|
import org.eclipse.cdt.debug.internal.ui.actions.CBreakpointPropertiesRulerAction;
|
||||||
import org.eclipse.cdt.debug.internal.ui.actions.EnableDisableBreakpointRulerAction;
|
import org.eclipse.cdt.debug.internal.ui.actions.EnableDisableBreakpointRulerAction;
|
||||||
import org.eclipse.cdt.debug.internal.ui.actions.ToggleBreakpointRulerAction;
|
import org.eclipse.cdt.debug.internal.ui.actions.ToggleBreakpointRulerAction;
|
||||||
|
import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DisassemblyDocumentProvider;
|
||||||
import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DisassemblyPane;
|
import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DisassemblyPane;
|
||||||
import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DocumentContentProvider;
|
import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DocumentContentProvider;
|
||||||
import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.VirtualDocument;
|
import org.eclipse.cdt.debug.internal.ui.disassembly.viewer.VirtualDocument;
|
||||||
|
@ -31,6 +32,8 @@ import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.jface.text.IRegion;
|
import org.eclipse.jface.text.IRegion;
|
||||||
import org.eclipse.jface.text.source.IAnnotationModel;
|
import org.eclipse.jface.text.source.IAnnotationModel;
|
||||||
import org.eclipse.jface.text.source.IVerticalRuler;
|
import org.eclipse.jface.text.source.IVerticalRuler;
|
||||||
|
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||||
|
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||||
|
@ -43,7 +46,7 @@ import org.eclipse.ui.part.EditorPart;
|
||||||
import org.eclipse.ui.texteditor.IDocumentProvider;
|
import org.eclipse.ui.texteditor.IDocumentProvider;
|
||||||
import org.eclipse.ui.texteditor.ITextEditor;
|
import org.eclipse.ui.texteditor.ITextEditor;
|
||||||
|
|
||||||
public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusableEditor, IDebugContextListener {
|
public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusableEditor, IDebugContextListener, IPropertyChangeListener {
|
||||||
|
|
||||||
private DisassemblyPane fDisassemblyPane;
|
private DisassemblyPane fDisassemblyPane;
|
||||||
|
|
||||||
|
@ -73,10 +76,14 @@ public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusa
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
|
* @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
@Override
|
@Override
|
||||||
public void init( IEditorSite site, IEditorInput input ) throws PartInitException {
|
public void init( IEditorSite site, IEditorInput input ) throws PartInitException {
|
||||||
setSite( site );
|
setSite( site );
|
||||||
setInput( input );
|
setInput( input );
|
||||||
|
((DisassemblyDocumentProvider)getDocumentProvider()).
|
||||||
|
getDocumentPresentation( input ).
|
||||||
|
addPropertyChangeListener( this );
|
||||||
DebugUITools.getDebugContextManager().addDebugContextListener( this );
|
DebugUITools.getDebugContextManager().addDebugContextListener( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,9 +145,13 @@ public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusa
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.part.WorkbenchPart#dispose()
|
* @see org.eclipse.ui.part.WorkbenchPart#dispose()
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
DebugUITools.getDebugContextManager().removeDebugContextListener( this );
|
DebugUITools.getDebugContextManager().removeDebugContextListener( this );
|
||||||
|
((DisassemblyDocumentProvider)getDocumentProvider()).
|
||||||
|
getDocumentPresentation( getEditorInput() ).
|
||||||
|
removePropertyChangeListener( this );
|
||||||
getDocumentProvider().disconnect( getEditorInput() );
|
getDocumentProvider().disconnect( getEditorInput() );
|
||||||
fDisassemblyPane.dispose();
|
fDisassemblyPane.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
@ -334,4 +345,11 @@ public class DisassemblyEditor extends EditorPart implements ITextEditor, IReusa
|
||||||
action= new CBreakpointPropertiesRulerAction( this, ruler );
|
action= new CBreakpointPropertiesRulerAction( this, ruler );
|
||||||
setAction( IInternalCDebugUIConstants.ACTION_BREAKPOINT_PROPERTIES, action );
|
setAction( IInternalCDebugUIConstants.ACTION_BREAKPOINT_PROPERTIES, action );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||||
|
*/
|
||||||
|
public void propertyChange( PropertyChangeEvent event ) {
|
||||||
|
getViewer().refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,14 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationConte
|
||||||
* org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DisassemblyEditorPresentation:
|
* org.eclipse.cdt.debug.internal.ui.disassembly.viewer.DisassemblyEditorPresentation:
|
||||||
* //TODO Add description.
|
* //TODO Add description.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public class DisassemblyEditorPresentation extends PresentationContext implements IDocumentPresentation {
|
public class DisassemblyEditorPresentation extends PresentationContext implements IDocumentPresentation {
|
||||||
|
|
||||||
|
public static final String PROPERTY_SHOW_INSTRUCTIONS = "PROPERTY_SHOW_INSTRUCTIONS"; //$NON-NLS-1$
|
||||||
|
public static final String PROPERTY_SHOW_SOURCE = "PROPERTY_SHOW_SOURCE"; //$NON-NLS-1$
|
||||||
|
public static final String PROPERTY_SHOW_ADDRESSES = "PROPERTY_SHOW_ADDRESSES"; //$NON-NLS-1$
|
||||||
|
public static final String PROPERTY_SHOW_LINE_NUMBERS = "PROPERTY_SHOW_LINE_NUMBERS"; //$NON-NLS-1$
|
||||||
|
|
||||||
private boolean fShowInstructions = true;
|
private boolean fShowInstructions = true;
|
||||||
private boolean fShowSource = false;
|
private boolean fShowSource = false;
|
||||||
|
|
||||||
|
@ -31,24 +37,24 @@ public class DisassemblyEditorPresentation extends PresentationContext implement
|
||||||
|
|
||||||
public DisassemblyEditorPresentation() {
|
public DisassemblyEditorPresentation() {
|
||||||
super( ICDebugUIConstants.ID_DEFAULT_DISASSEMBLY_EDITOR );
|
super( ICDebugUIConstants.ID_DEFAULT_DISASSEMBLY_EDITOR );
|
||||||
fShowInstructions = CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_DISASM_SHOW_INSTRUCTIONS );
|
setProperty( PROPERTY_SHOW_INSTRUCTIONS, Boolean.valueOf( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_DISASM_SHOW_INSTRUCTIONS ) ) );
|
||||||
fShowSource = CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_DISASM_SHOW_SOURCE );
|
setProperty( PROPERTY_SHOW_SOURCE, Boolean.valueOf( CDebugUIPlugin.getDefault().getPreferenceStore().getBoolean( ICDebugPreferenceConstants.PREF_DISASM_SHOW_SOURCE ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showIntstructions() {
|
public boolean showIntstructions() {
|
||||||
return fShowInstructions;
|
return ((Boolean)getProperty( PROPERTY_SHOW_INSTRUCTIONS )).booleanValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShowIntstructions( boolean showIntstructions ) {
|
public void setShowIntstructions( boolean showIntstructions ) {
|
||||||
fShowInstructions = showIntstructions;
|
setProperty( PROPERTY_SHOW_INSTRUCTIONS, Boolean.valueOf( showIntstructions ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showSource() {
|
public boolean showSource() {
|
||||||
return fShowSource;
|
return ((Boolean)getProperty( PROPERTY_SHOW_SOURCE )).booleanValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShowSource( boolean showSource ) {
|
public void setShowSource( boolean showSource ) {
|
||||||
fShowSource = showSource;
|
setProperty( PROPERTY_SHOW_SOURCE, Boolean.valueOf( showSource ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showAddresses() {
|
public boolean showAddresses() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue