mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 23:15:24 +02:00
[211487] - Changed the input provider to apply to threads as well.
This commit is contained in:
parent
94f0b1a811
commit
b148191afa
2 changed files with 23 additions and 25 deletions
|
@ -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.IElementMementoProvider;
|
||||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
|
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")
|
@SuppressWarnings("restriction")
|
||||||
public class RegisterRootDMVMNode extends RootDMVMNode implements IElementMementoProvider {
|
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) {
|
public RegisterRootDMVMNode(AbstractVMProvider provider) {
|
||||||
super(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[])
|
* @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) {
|
public void compareElements(IElementCompareRequest[] requests) {
|
||||||
|
for ( IElementMementoRequest request : requests ) { request.done(); }
|
||||||
for ( IElementCompareRequest request : requests ) { request.done(); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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.internal.provisional.ui.viewmodel.update.BreakpointHitUpdatePolicy;
|
||||||
import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext;
|
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.IRunControl.ISuspendedDMEvent;
|
||||||
import org.eclipse.dd.dsf.debug.service.IStack.IFrameDMContext;
|
|
||||||
import org.eclipse.dd.dsf.service.DsfSession;
|
import org.eclipse.dd.dsf.service.DsfSession;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter;
|
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMContext;
|
import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMContext;
|
||||||
|
@ -148,27 +147,25 @@ public class RegisterVMProvider extends AbstractDMVMProvider
|
||||||
@Override
|
@Override
|
||||||
public void update(IViewerInputUpdate update) {
|
public void update(IViewerInputUpdate update) {
|
||||||
/*
|
/*
|
||||||
* Get the selection input object from and see if it is a STACK FRAME. If not then do
|
* Use the execution context in the current selection as the input provider.
|
||||||
* the standard policy. If it is then we will always provide and execution selection.
|
|
||||||
* This insures that the REGISTER VIEW will not collapse and expand on stepping or on
|
* 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
|
* 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.
|
* specific. If it were to become so then we would need to modify this policy.
|
||||||
*/
|
*/
|
||||||
Object element = update.getElement();
|
Object element = update.getElement();
|
||||||
IDMContext ctx = ((IDMVMContext) element).getDMContext();
|
IDMContext ctx = ((IDMVMContext) element).getDMContext();
|
||||||
if ( ctx instanceof IFrameDMContext ) {
|
|
||||||
IExecutionDMContext execDmc = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class);
|
IExecutionDMContext execDmc = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class);
|
||||||
if ( execDmc != null ) {
|
if ( execDmc != null ) {
|
||||||
/*
|
/*
|
||||||
* This tells the Flexible Hierarchy that element driving this view has not changed
|
* 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
|
* 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.
|
* we provide our Root Layout node as the representative VM node.
|
||||||
*/
|
*/
|
||||||
update.setInputElement(new ViewInputElement(RegisterVMProvider.this.getRootVMNode(), execDmc));
|
update.setInputElement(new ViewInputElement(RegisterVMProvider.this.getRootVMNode(), execDmc));
|
||||||
update.done();
|
update.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we reach here, then we did not override the standard behavior. Invoke the
|
* If we reach here, then we did not override the standard behavior. Invoke the
|
||||||
|
|
Loading…
Add table
Reference in a new issue