1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +02:00

[211487] - Changed the input provider to apply to threads as well.

This commit is contained in:
Pawel Piech 2008-05-16 21:47:00 +00:00
parent 94f0b1a811
commit b148191afa
2 changed files with 23 additions and 25 deletions

View file

@ -16,16 +16,18 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRe
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
/*
* We are extending the ROOT VM node for the register view so we can
* provide Memento providers for the root node. In the Register VM
* Provider we are returning a pseudo VMContext selection when the
* original input is a child of an execution context we return a selection
* which represents an Execution Context instead. This ensures that the
* Register View does not collapse and redraw when going from frame to frame
* when stepping or just when selecting within the view.
*/
@SuppressWarnings("restriction")
public class RegisterRootDMVMNode extends RootDMVMNode implements IElementMementoProvider {
/*
* We are extending the ROOT VM node for the register view so we can provide Memento providers for the root
* node. In the Register VM Provider we are returning a pseudo VMContext selection when the original input
* is a StackFrame we return a selection which represents an Execution Context instead. This ensures that
* the Register View does not collapse and redraw when going from frame to frame when stepping or just when
* selecting within the view.
*/
public RegisterRootDMVMNode(AbstractVMProvider provider) {
super(provider);
}
@ -35,8 +37,7 @@ public class RegisterRootDMVMNode extends RootDMVMNode implements IElementMement
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#compareElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest[])
*/
public void compareElements(IElementCompareRequest[] requests) {
for ( IElementCompareRequest request : requests ) { request.done(); }
for ( IElementMementoRequest request : requests ) { request.done(); }
}
/*

View file

@ -16,7 +16,6 @@ import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.numberformat.F
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy;
import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.dd.dsf.debug.service.IRunControl.ISuspendedDMEvent;
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
import org.eclipse.dd.dsf.service.DsfSession;
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter;
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMContext;
@ -148,27 +147,25 @@ public class RegisterVMProvider extends AbstractDMVMProvider
@Override
public void update(IViewerInputUpdate update) {
/*
* Get the selection input object from and see if it is a STACK FRAME. If not then do
* the standard policy. If it is then we will always provide and execution selection.
* Use the execution context in the current selection as the input provider.
* This insures that the REGISTER VIEW will not collapse and expand on stepping or on
* re-selection in the DEBUG VIEW. Currently the register content is not stack frame
* specific. If it were to become so then we would need to modify this policy.
*/
Object element = update.getElement();
IDMContext ctx = ((IDMVMContext) element).getDMContext();
if ( ctx instanceof IFrameDMContext ) {
IExecutionDMContext execDmc = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class);
if ( execDmc != null ) {
/*
* This tells the Flexible Hierarchy that element driving this view has not changed
* and there is no need to redraw the view. Since this is a somewhat fake VMContext
* we provide our Root Layout node as the representative VM node.
*/
update.setInputElement(new ViewInputElement(RegisterVMProvider.this.getRootVMNode(), execDmc));
update.done();
return;
}
}
IExecutionDMContext execDmc = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class);
if ( execDmc != null ) {
/*
* This tells the Flexible Hierarchy that element driving this view has not changed
* and there is no need to redraw the view. Since this is a somewhat fake VMContext
* we provide our Root Layout node as the representative VM node.
*/
update.setInputElement(new ViewInputElement(RegisterVMProvider.this.getRootVMNode(), execDmc));
update.done();
return;
}
/*
* If we reach here, then we did not override the standard behavior. Invoke the