1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Refresh the Disassembly view on change events.

This commit is contained in:
Mikhail Khodjaiants 2004-05-14 20:15:07 +00:00
parent 855b524f20
commit f3db89773b
4 changed files with 38 additions and 9 deletions

View file

@ -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
Removed old disassembly implementation.
* SwitchToDisassemblyActionDelegate.java: deleted

View file

@ -270,16 +270,11 @@ public class DisassemblyEditorInput implements IEditorInput {
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() {
return this.fSourceRegions;
}
protected IDisassembly getDisassembly() {
return ( fBlock != null ) ? fBlock.getDisassembly() : null;
}
}

View file

@ -15,6 +15,7 @@ import java.util.Iterator;
import java.util.Map;
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.IInternalCDebugUIConstants;
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.ui.CDebugUIPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IThread;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
@ -906,4 +909,20 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
}
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 );
}
}
}

View file

@ -10,6 +10,7 @@
***********************************************************************/
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.debug.core.DebugEvent;
import org.eclipse.debug.ui.AbstractDebugView;
@ -45,6 +46,9 @@ public class DisassemblyViewEventHandler extends AbstractDebugEventHandler {
case DebugEvent.RESUME:
handleResumeEvent( events[i] );
break;
case DebugEvent.CHANGE:
handleChangeEvent( events[i] );
break;
}
}
}
@ -70,6 +74,11 @@ public class DisassemblyViewEventHandler extends AbstractDebugEventHandler {
private void handleSuspendEvent( DebugEvent event ) {
}
private void handleChangeEvent( DebugEvent event ) {
if ( event.getSource() instanceof IDisassembly )
getDisassemblyView().refresh( (IDisassembly)event.getSource() );
}
protected DisassemblyView getDisassemblyView() {
return (DisassemblyView)getView();
}