diff options
author | Alvaro Sanchez-Leon | 2013-09-18 13:09:16 +0000 |
---|---|---|
committer | Marc Khouzam | 2013-09-27 14:07:02 +0000 |
commit | 6c85c85a06dd20276ee65642c2d9c48dca0fd4e0 (patch) | |
tree | 649984cb7835c2d5f01792d515f16ef66d808e63 /dsf/org.eclipse.cdt.dsf.ui | |
parent | c92d135f6df4fcc4fbaf2c519f9474cd3d6d8250 (diff) | |
download | org.eclipse.cdt-6c85c85a06dd20276ee65642c2d9c48dca0fd4e0.tar.gz org.eclipse.cdt-6c85c85a06dd20276ee65642c2d9c48dca0fd4e0.tar.xz org.eclipse.cdt-6c85c85a06dd20276ee65642c2d9c48dca0fd4e0.zip |
Bug 323552: [registers] Register View content is not stack frame
specific
Change-Id: Ib7922f8487d10e3b9cb5b6dcb255590cc31d2a97
Signed-off-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
Reviewed-on: https://git.eclipse.org/r/16566
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
Diffstat (limited to 'dsf/org.eclipse.cdt.dsf.ui')
2 files changed, 18 insertions, 10 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMNode.java index 81dafb8f28d..1a4e393859c 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMNode.java @@ -7,6 +7,7 @@ * * Contributors: * Wind River Systems - initial API and implementation + * Alvaro Sanchez-Leon (Ericsson) - Make Registers View specific to a frame (Bug 323552) *******************************************************************************/ package org.eclipse.cdt.dsf.debug.ui.viewmodel.register; @@ -29,6 +30,7 @@ import org.eclipse.cdt.dsf.debug.service.IRegisters.IRegisterDMContext; import org.eclipse.cdt.dsf.debug.service.IRegisters.IRegisterDMData; import org.eclipse.cdt.dsf.debug.service.IRegisters.IRegisterGroupDMData; import org.eclipse.cdt.dsf.debug.service.IRegisters.IRegistersChangedDMEvent; +import org.eclipse.cdt.dsf.debug.service.IRunControl.IResumedDMEvent; import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent; import org.eclipse.cdt.dsf.debug.ui.viewmodel.ErrorLabelForeground; import org.eclipse.cdt.dsf.debug.ui.viewmodel.ErrorLabelText; @@ -672,6 +674,7 @@ public class RegisterVMNode extends AbstractExpressionVMNode @Override public int getDeltaFlags(Object e) { if ( e instanceof ISuspendedDMEvent || + e instanceof IResumedDMEvent || e instanceof IMemoryChangedEvent || e instanceof IRegistersChangedDMEvent || (e instanceof PropertyChangeEvent && @@ -697,6 +700,7 @@ public class RegisterVMNode extends AbstractExpressionVMNode // The following events can affect any register's values, // refresh the contents of the parent element (i.e. all the registers). if ( e instanceof ISuspendedDMEvent || + e instanceof IResumedDMEvent || e instanceof IMemoryChangedEvent || e instanceof IRegistersChangedDMEvent || (e instanceof PropertyChangeEvent && diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMProvider.java index 8bb035c73c1..1835d0cda74 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterVMProvider.java @@ -7,6 +7,7 @@ * * Contributors: * Wind River Systems - initial API and implementation + * Alvaro Sanchez-Leon (Ericsson) - Make Registers View specific to a frame (Bug 323552) *******************************************************************************/ package org.eclipse.cdt.dsf.debug.ui.viewmodel.register; @@ -19,6 +20,7 @@ import org.eclipse.cdt.dsf.debug.service.ICachingService; import org.eclipse.cdt.dsf.debug.service.IRegisters; import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent; +import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext; import org.eclipse.cdt.dsf.debug.ui.DsfDebugUITools; import org.eclipse.cdt.dsf.debug.ui.IDsfDebugUIConstants; import org.eclipse.cdt.dsf.debug.ui.viewmodel.update.BreakpointHitUpdatePolicy; @@ -168,24 +170,26 @@ public class RegisterVMProvider extends AbstractDMVMProvider */ @Override public void update(IViewerInputUpdate update) { - /* - * 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. - */ + /* + * Using the frame context as first alternative to display register values per stack frame + * if not available e.g. user selected a thread, the execution context is used instead + */ Object element = update.getElement(); if (element instanceof IDMVMContext) { IDMContext ctx = ((IDMVMContext) element).getDMContext(); - - IExecutionDMContext execDmc = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class); - if ( execDmc != null ) { + + IDMContext selDmc = DMContexts.getAncestorOfType(ctx, IFrameDMContext.class); + if (selDmc == null) { + selDmc = DMContexts.getAncestorOfType(ctx, IExecutionDMContext.class); + } + + if ( selDmc != 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.setInputElement(new ViewInputElement(RegisterVMProvider.this.getRootVMNode(), selDmc)); update.done(); return; } |