mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-27 19:05:38 +02:00
Refresh the Disassembly view on change events.
This commit is contained in:
parent
855b524f20
commit
f3db89773b
4 changed files with 38 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-05-14 Mikhail Khodjaiants
|
||||||
|
Refresh the Disassembly view on change events.
|
||||||
|
* DisassemblyEditorInput.java
|
||||||
|
* DisassemblyView.java
|
||||||
|
* DisassemblyViewEventHandler.java
|
||||||
|
|
||||||
2004-05-13 Mikhail Khodjaiants
|
2004-05-13 Mikhail Khodjaiants
|
||||||
Removed old disassembly implementation.
|
Removed old disassembly implementation.
|
||||||
* SwitchToDisassemblyActionDelegate.java: deleted
|
* SwitchToDisassemblyActionDelegate.java: deleted
|
||||||
|
|
|
@ -270,16 +270,11 @@ public class DisassemblyEditorInput implements IEditorInput {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private void addSourceLineRegion( int offset, int length ) {
|
|
||||||
// if ( fTextPresentation != null ) {
|
|
||||||
// fTextPresentation.addStyleRange( new StyleRange( offset,
|
|
||||||
// length,
|
|
||||||
// JFaceResources.getColorRegistry().get( IInternalCDebugUIConstants.DISASSEMBLY_SOURCE_LINE_COLOR ),
|
|
||||||
// null ) );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
public IRegion[] getSourceRegions() {
|
public IRegion[] getSourceRegions() {
|
||||||
return this.fSourceRegions;
|
return this.fSourceRegions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected IDisassembly getDisassembly() {
|
||||||
|
return ( fBlock != null ) ? fBlock.getDisassembly() : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
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.internal.ui.ICDebugHelpContextIds;
|
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
|
||||||
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
|
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;
|
||||||
|
@ -25,11 +26,13 @@ import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandlerView;
|
||||||
import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler;
|
import org.eclipse.cdt.debug.internal.ui.views.IDebugExceptionHandler;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.core.model.IThread;
|
import org.eclipse.debug.core.model.IThread;
|
||||||
|
import org.eclipse.debug.ui.DebugUITools;
|
||||||
import org.eclipse.debug.ui.IDebugUIConstants;
|
import org.eclipse.debug.ui.IDebugUIConstants;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.jface.action.IMenuListener;
|
import org.eclipse.jface.action.IMenuListener;
|
||||||
|
@ -906,4 +909,20 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void refresh( IDisassembly disassembly ) {
|
||||||
|
if ( !(getInput() instanceof DisassemblyEditorInput) || !disassembly.equals( ((DisassemblyEditorInput)getInput()).getDisassembly() ) )
|
||||||
|
return;
|
||||||
|
resetViewerInput();
|
||||||
|
if ( !isAvailable() || !isVisible() )
|
||||||
|
return;
|
||||||
|
IAdaptable context = DebugUITools.getDebugContext();
|
||||||
|
if ( context instanceof ICStackFrame ) {
|
||||||
|
fLastStackFrame = (ICStackFrame)context;
|
||||||
|
IEditorInput input = getInput();
|
||||||
|
if ( input instanceof DisassemblyEditorInput )
|
||||||
|
setViewerInput( DisassemblyEditorInput.PENDING_EDITOR_INPUT );
|
||||||
|
computeInput( input, (ICStackFrame)context, this );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
|
package org.eclipse.cdt.debug.internal.ui.views.disassembly;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.core.model.IDisassembly;
|
||||||
import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler;
|
import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler;
|
||||||
import org.eclipse.debug.core.DebugEvent;
|
import org.eclipse.debug.core.DebugEvent;
|
||||||
import org.eclipse.debug.ui.AbstractDebugView;
|
import org.eclipse.debug.ui.AbstractDebugView;
|
||||||
|
@ -45,6 +46,9 @@ public class DisassemblyViewEventHandler extends AbstractDebugEventHandler {
|
||||||
case DebugEvent.RESUME:
|
case DebugEvent.RESUME:
|
||||||
handleResumeEvent( events[i] );
|
handleResumeEvent( events[i] );
|
||||||
break;
|
break;
|
||||||
|
case DebugEvent.CHANGE:
|
||||||
|
handleChangeEvent( events[i] );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,6 +74,11 @@ public class DisassemblyViewEventHandler extends AbstractDebugEventHandler {
|
||||||
private void handleSuspendEvent( DebugEvent event ) {
|
private void handleSuspendEvent( DebugEvent event ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleChangeEvent( DebugEvent event ) {
|
||||||
|
if ( event.getSource() instanceof IDisassembly )
|
||||||
|
getDisassemblyView().refresh( (IDisassembly)event.getSource() );
|
||||||
|
}
|
||||||
|
|
||||||
protected DisassemblyView getDisassemblyView() {
|
protected DisassemblyView getDisassemblyView() {
|
||||||
return (DisassemblyView)getView();
|
return (DisassemblyView)getView();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue