From b148191afaa0e081e5759dc6426acb7dc40b9c09 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Fri, 16 May 2008 21:47:00 +0000 Subject: [PATCH] [211487] - Changed the input provider to apply to threads as well. --- .../register/RegisterRootDMVMNode.java | 19 ++++++------ .../register/RegisterVMProvider.java | 29 +++++++++---------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterRootDMVMNode.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterRootDMVMNode.java index 4f4a16d1b9d..8dcfc5017a9 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterRootDMVMNode.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterRootDMVMNode.java @@ -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(); } } /* diff --git a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMProvider.java b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMProvider.java index 4fb90cf8903..121c17b0c90 100644 --- a/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMProvider.java +++ b/plugins/org.eclipse.dd.dsf.debug.ui/src/org/eclipse/dd/dsf/debug/internal/provisional/ui/viewmodel/register/RegisterVMProvider.java @@ -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