mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +02:00
[202649] - [update policy][debug view] Add manual refresh mode for thread list in debug view.
This commit is contained in:
parent
884e607aab
commit
1e0365550e
33 changed files with 467 additions and 135 deletions
|
@ -31,6 +31,7 @@ action.breakpointProperties.label = Breakpoint Properties...
|
||||||
action.refresh.label = Refresh
|
action.refresh.label = Refresh
|
||||||
|
|
||||||
menu.updatePolicy = Update Policy
|
menu.updatePolicy = Update Policy
|
||||||
|
menu.threadsUpdatePolicy = Threads Update Policy
|
||||||
action.breakpointHitUpdatePolicy.label = Breakpoint Hit
|
action.breakpointHitUpdatePolicy.label = Breakpoint Hit
|
||||||
action.manualUpdatePolicy.label = Manual
|
action.manualUpdatePolicy.label = Manual
|
||||||
action.automaticUpdatePolicy.label = Automatic
|
action.automaticUpdatePolicy.label = Automatic
|
||||||
|
|
|
@ -319,6 +319,41 @@
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
</viewContribution>
|
</viewContribution>
|
||||||
|
|
||||||
|
<!-- Debug View menu contributions -->
|
||||||
|
<viewContribution
|
||||||
|
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.debugView.Refresh"
|
||||||
|
targetID="org.eclipse.debug.ui.DebugView">
|
||||||
|
<action
|
||||||
|
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.RefreshActionDelegate"
|
||||||
|
icon="icons/refresh.gif"
|
||||||
|
id="org.eclipse.dd.dsf.debug.ui.viewmodel.update.actions.Refresh"
|
||||||
|
label="%action.refresh.label"
|
||||||
|
toolbarPath="additions">
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<menu id="updatePolicy"
|
||||||
|
label="%menu.threadsUpdatePolicy"
|
||||||
|
path="additions"/>
|
||||||
|
<action
|
||||||
|
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.ManualUpdatePolicyAction"
|
||||||
|
helpContextId="org.eclipse.dd.dsf.debug.ui.UpdatePolicy_Manual_helpContext"
|
||||||
|
id="org.eclipse.dd.dsf.debug.ui.UpdatePolicy_Manual"
|
||||||
|
label="%action.manualUpdatePolicy.label"
|
||||||
|
menubarPath="updatePolicy/additions"
|
||||||
|
style="radio">
|
||||||
|
</action>
|
||||||
|
<action
|
||||||
|
class="org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.update.actions.AutomaticUpdatePolicyAction"
|
||||||
|
helpContextId="org.eclipse.dd.dsf.debug.ui.UpdatePolicy_Automatic_helpContext"
|
||||||
|
id="org.eclipse.dd.dsf.debug.ui.UpdatePolicy_Automatic"
|
||||||
|
label="%action.automaticUpdatePolicy.label"
|
||||||
|
menubarPath="updatePolicy/additions"
|
||||||
|
state="true"
|
||||||
|
style="radio">
|
||||||
|
</action>
|
||||||
|
</viewContribution>
|
||||||
|
|
||||||
</extension>
|
</extension>
|
||||||
|
|
||||||
<extension
|
<extension
|
||||||
|
|
|
@ -138,6 +138,11 @@ public class ExpressionManagerVMNode extends AbstractVMNode
|
||||||
super(provider);
|
super(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ExpressionManagerVMNode"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
private ExpressionVMProvider getExpressionVMProvider() {
|
private ExpressionVMProvider getExpressionVMProvider() {
|
||||||
return (ExpressionVMProvider)getVMProvider();
|
return (ExpressionVMProvider)getVMProvider();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,9 @@ import org.eclipse.dd.dsf.ui.viewmodel.AbstractVMAdapter;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.IRootVMNode;
|
import org.eclipse.dd.dsf.ui.viewmodel.IRootVMNode;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.IVMModelProxy;
|
import org.eclipse.dd.dsf.ui.viewmodel.IVMModelProxy;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
|
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
|
||||||
|
import org.eclipse.dd.dsf.ui.viewmodel.update.AutomaticUpdatePolicy;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.update.IVMUpdatePolicy;
|
import org.eclipse.dd.dsf.ui.viewmodel.update.IVMUpdatePolicy;
|
||||||
|
import org.eclipse.dd.dsf.ui.viewmodel.update.ManualUpdatePolicy;
|
||||||
import org.eclipse.debug.core.DebugEvent;
|
import org.eclipse.debug.core.DebugEvent;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.core.IDebugEventSetListener;
|
import org.eclipse.debug.core.IDebugEventSetListener;
|
||||||
|
@ -63,7 +65,10 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IVMUpdatePolicy[] createUpdateModes() {
|
protected IVMUpdatePolicy[] createUpdateModes() {
|
||||||
return new IVMUpdatePolicy[] { new DelayedStackRefreshUpdatePolicy() };
|
return new IVMUpdatePolicy[] {
|
||||||
|
new DelayedStackRefreshUpdatePolicy(new AutomaticUpdatePolicy()),
|
||||||
|
new DelayedStackRefreshUpdatePolicy(new ManualUpdatePolicy())
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleDebugEvents(final DebugEvent[] events) {
|
public void handleDebugEvents(final DebugEvent[] events) {
|
||||||
|
|
|
@ -259,8 +259,8 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode
|
||||||
// ISteppingTimedOutEvent will trigger a refresh.
|
// ISteppingTimedOutEvent will trigger a refresh.
|
||||||
if (((IResumedDMEvent)e).getReason() != IRunControl.StateChangeReason.STEP) {
|
if (((IResumedDMEvent)e).getReason() != IRunControl.StateChangeReason.STEP) {
|
||||||
parentDelta.addNode(createVMContext(dmc), IModelDelta.CONTENT);
|
parentDelta.addNode(createVMContext(dmc), IModelDelta.CONTENT);
|
||||||
rm.done();
|
|
||||||
}
|
}
|
||||||
|
rm.done();
|
||||||
} else if (e instanceof ISuspendedDMEvent) {
|
} else if (e instanceof ISuspendedDMEvent) {
|
||||||
// Container suspended. Do nothing here to give the stack the
|
// Container suspended. Do nothing here to give the stack the
|
||||||
// priority in updating. The thread will update as a result of
|
// priority in updating. The thread will update as a result of
|
||||||
|
|
|
@ -11,42 +11,54 @@
|
||||||
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch;
|
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch;
|
||||||
|
|
||||||
import org.eclipse.dd.dsf.datamodel.IDMContext;
|
import org.eclipse.dd.dsf.datamodel.IDMContext;
|
||||||
|
import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||||
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.IExitedDMEvent;
|
||||||
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.debug.service.IStack.IFrameDMContext;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.IDMVMContext;
|
import org.eclipse.dd.dsf.ui.viewmodel.datamodel.IDMVMContext;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.update.AutomaticUpdatePolicy;
|
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.update.IElementUpdateTester;
|
import org.eclipse.dd.dsf.ui.viewmodel.update.IElementUpdateTester;
|
||||||
|
import org.eclipse.dd.dsf.ui.viewmodel.update.IVMUpdatePolicy;
|
||||||
|
import org.eclipse.dd.dsf.ui.viewmodel.update.UpdatePolicyDecorator;
|
||||||
import org.eclipse.jface.viewers.TreePath;
|
import org.eclipse.jface.viewers.TreePath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Automatic update strategy specialized for delayed full stack frame updates. The
|
* An update strategy decorator specialized for delayed stack frame refresh. The
|
||||||
* strategy can operate in lazy mode where only the top stack frame is
|
* strategy flushes only the cached top stack frame in case of an normal {@link ISuspendedDMEvent},
|
||||||
* invalidated, while in non-lazy mode everything is invalidated.
|
* while in in case of a special {@link FullStackRefreshEvent} everything is invalidated.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* The underlying base update policy is considered for container contexts only.
|
||||||
|
* </p>
|
||||||
*/
|
*/
|
||||||
public class DelayedStackRefreshUpdatePolicy extends AutomaticUpdatePolicy {
|
public class DelayedStackRefreshUpdatePolicy extends UpdatePolicyDecorator {
|
||||||
|
|
||||||
private static final class DelayedStackRefreshUpdateTester implements IElementUpdateTester {
|
private static final class DelayedStackRefreshUpdateTester implements IElementUpdateTester {
|
||||||
|
|
||||||
private final boolean fLazyMode;
|
private final IElementUpdateTester fBaseTester;
|
||||||
DelayedStackRefreshUpdateTester(boolean lazyMode) {
|
|
||||||
fLazyMode= lazyMode;
|
/** Indicates whether only the top stack frame should be updated */
|
||||||
|
private final boolean fLazyStackFrameMode;
|
||||||
|
|
||||||
|
DelayedStackRefreshUpdateTester(IElementUpdateTester baseTester, boolean lazyStackFrameMode) {
|
||||||
|
fBaseTester = baseTester;
|
||||||
|
fLazyStackFrameMode = lazyStackFrameMode;
|
||||||
}
|
}
|
||||||
public int getUpdateFlags(Object viewerInput, TreePath path) {
|
public int getUpdateFlags(Object viewerInput, TreePath path) {
|
||||||
if (fLazyMode) {
|
Object element = path.getSegmentCount() != 0 ? path.getLastSegment() : viewerInput;
|
||||||
Object element = path.getSegmentCount() != 0 ? path.getLastSegment() : viewerInput;
|
if (element instanceof IDMVMContext) {
|
||||||
if (element instanceof IDMVMContext) {
|
IDMContext dmc = ((IDMVMContext) element).getDMContext();
|
||||||
IDMContext dmc= ((IDMVMContext) element).getDMContext();
|
if (fLazyStackFrameMode) {
|
||||||
if (dmc instanceof IFrameDMContext) {
|
if (dmc instanceof IFrameDMContext) {
|
||||||
if (((IFrameDMContext) dmc).getLevel() > 0) {
|
if (((IFrameDMContext) dmc).getLevel() == 0) {
|
||||||
// mark as dirty only
|
|
||||||
return DIRTY;
|
|
||||||
} else {
|
|
||||||
return FLUSH;
|
return FLUSH;
|
||||||
}
|
}
|
||||||
} else if (dmc instanceof IExecutionDMContext) {
|
} else if (dmc instanceof IExecutionDMContext) {
|
||||||
return DIRTY;
|
return fBaseTester.getUpdateFlags(viewerInput, path);
|
||||||
}
|
}
|
||||||
|
return DIRTY;
|
||||||
|
} else if (dmc instanceof IContainerDMContext) {
|
||||||
|
return fBaseTester.getUpdateFlags(viewerInput, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FLUSH;
|
return FLUSH;
|
||||||
|
@ -55,50 +67,106 @@ public class DelayedStackRefreshUpdatePolicy extends AutomaticUpdatePolicy {
|
||||||
public boolean includes(IElementUpdateTester tester) {
|
public boolean includes(IElementUpdateTester tester) {
|
||||||
// A non-lazy tester includes a lazy tester, but not vice versa.
|
// A non-lazy tester includes a lazy tester, but not vice versa.
|
||||||
// This allows entries that were marked as dirty by a flush with
|
// This allows entries that were marked as dirty by a flush with
|
||||||
// the lazy mode to be superceded by a non-lazy update which
|
// the lazy mode to be superseded by a non-lazy update which
|
||||||
// actually clears the entries that were marked as dirty.
|
// actually clears the entries that were marked as dirty.
|
||||||
if (tester instanceof DelayedStackRefreshUpdateTester) {
|
if (tester instanceof DelayedStackRefreshUpdateTester) {
|
||||||
DelayedStackRefreshUpdateTester sfTester = (DelayedStackRefreshUpdateTester)tester;
|
DelayedStackRefreshUpdateTester sfTester = (DelayedStackRefreshUpdateTester)tester;
|
||||||
if (fLazyMode) {
|
if (fLazyStackFrameMode) {
|
||||||
return sfTester.fLazyMode;
|
if (sfTester.fLazyStackFrameMode) {
|
||||||
|
return fBaseTester.includes(sfTester.fBaseTester);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
if (!sfTester.fLazyStackFrameMode) {
|
||||||
|
return fBaseTester.includes(sfTester.fBaseTester);
|
||||||
|
}
|
||||||
|
// non-lazy includes lazy
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Delayed stack refresh (lazy = " + fLazyStackFrameMode + ", base = " + fBaseTester + ") update tester"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String DELAYED_UPDATE_POLICY_ID= "org.eclipse.dd.dsf.ui.viewmodel.update.lazyUpdatePolicy"; //$NON-NLS-1$
|
private static final class ThreadsUpdateTester implements IElementUpdateTester {
|
||||||
|
|
||||||
private static final DelayedStackRefreshUpdateTester fgLazyUpdateTester= new DelayedStackRefreshUpdateTester(true);
|
private final IElementUpdateTester fBaseTester;
|
||||||
private static final DelayedStackRefreshUpdateTester fgNonLazyUpdateTester= new DelayedStackRefreshUpdateTester(false);
|
|
||||||
|
private final boolean fRefreshAll;
|
||||||
|
|
||||||
|
ThreadsUpdateTester(IElementUpdateTester baseTester, boolean refreshAll) {
|
||||||
|
fBaseTester = baseTester;
|
||||||
|
fRefreshAll = refreshAll;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUpdateFlags(Object viewerInput, TreePath path) {
|
||||||
|
Object element = path.getSegmentCount() != 0 ? path.getLastSegment() : viewerInput;
|
||||||
|
|
||||||
|
if (!fRefreshAll && element instanceof IDMVMContext) {
|
||||||
|
IDMContext dmc = ((IDMVMContext) element).getDMContext();
|
||||||
|
if (dmc instanceof IContainerDMContext) {
|
||||||
|
return fBaseTester.getUpdateFlags(viewerInput, path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the element is not a container or if the flush all flag is set,
|
||||||
|
// always flush it.
|
||||||
|
return FLUSH;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean includes(IElementUpdateTester tester) {
|
||||||
|
// A refresh-all tester includes a non-refresh-all tester, but not
|
||||||
|
// vice versa. This allows entries that were marked as dirty by
|
||||||
|
// a flush with
|
||||||
|
// the non-refresh-all to be superseded by a refresh-all update which
|
||||||
|
// actually clears the entries that were marked as dirty.
|
||||||
|
if (tester instanceof ThreadsUpdateTester) {
|
||||||
|
ThreadsUpdateTester threadsTester = (ThreadsUpdateTester)tester;
|
||||||
|
if (fRefreshAll) {
|
||||||
|
if (threadsTester.fRefreshAll) {
|
||||||
|
return fBaseTester.includes(threadsTester.fBaseTester);
|
||||||
|
}
|
||||||
|
// refresh-all includes the non-refresh-all
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
if (!threadsTester.fRefreshAll) {
|
||||||
|
return fBaseTester.includes(threadsTester.fBaseTester);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Threads update tester (base = " + fBaseTester + ") update tester"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public DelayedStackRefreshUpdatePolicy(IVMUpdatePolicy base) {
|
||||||
|
super(base);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IElementUpdateTester getElementUpdateTester(Object event) {
|
public IElementUpdateTester getElementUpdateTester(Object event) {
|
||||||
if (event instanceof ISuspendedDMEvent) {
|
if (event instanceof ISuspendedDMEvent) {
|
||||||
return fgLazyUpdateTester;
|
return new DelayedStackRefreshUpdateTester(getBaseUpdatePolicy().getElementUpdateTester(event), true);
|
||||||
} else if (event instanceof FullStackRefreshEvent) {
|
} else if (event instanceof FullStackRefreshEvent) {
|
||||||
return fgNonLazyUpdateTester;
|
return new DelayedStackRefreshUpdateTester(getBaseUpdatePolicy().getElementUpdateTester(event), false);
|
||||||
|
} else if (event instanceof IExitedDMEvent &&
|
||||||
|
((IExitedDMEvent)event).getDMContext() instanceof IContainerDMContext)
|
||||||
|
{
|
||||||
|
// container exit should always trigger a refresh
|
||||||
|
return new ThreadsUpdateTester(super.getElementUpdateTester(event), true);
|
||||||
} else {
|
} else {
|
||||||
return super.getElementUpdateTester(event);
|
return new ThreadsUpdateTester(super.getElementUpdateTester(event), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @see org.eclipse.dd.dsf.ui.viewmodel.update.IVMUpdatePolicy#getID()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getID() {
|
|
||||||
return DELAYED_UPDATE_POLICY_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @see org.eclipse.dd.dsf.ui.viewmodel.update.IVMUpdatePolicy#getName()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return "Delayed Stack Refresh"; //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,11 @@ public class LaunchRootVMNode extends RootVMNode
|
||||||
super(provider);
|
super(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "LaunchRootVMNode"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDeltaEvent(Object rootObject, Object e) {
|
public boolean isDeltaEvent(Object rootObject, Object e) {
|
||||||
if (e instanceof DebugEvent) {
|
if (e instanceof DebugEvent) {
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2008 Wind River Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Wind River Systems - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch;
|
||||||
|
|
||||||
|
import org.eclipse.osgi.util.NLS;
|
||||||
|
|
||||||
|
public class LaunchVMUpdateMessages extends NLS {
|
||||||
|
|
||||||
|
private static final String BUNDLE_NAME = "org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.LaunchVMUpdateMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
public static String ThreadsAutomaticUpdatePolicy_name;
|
||||||
|
public static String ThreadsManualUpdatePolicy_name;
|
||||||
|
|
||||||
|
static {
|
||||||
|
// load message values from bundle file
|
||||||
|
NLS.initializeMessages(BUNDLE_NAME, LaunchVMUpdateMessages.class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -58,6 +58,11 @@ public class StackFramesVMNode extends AbstractDMVMNode
|
||||||
super(provider, session, IStack.IFrameDMContext.class);
|
super(provider, session, IStack.IFrameDMContext.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "StackFramesVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMNode#updateHasElementsInSessionThread(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate)
|
* @see org.eclipse.dd.dsf.ui.viewmodel.datamodel.AbstractDMVMNode#updateHasElementsInSessionThread(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate)
|
||||||
|
|
|
@ -89,6 +89,11 @@ public class StandardProcessVMNode extends AbstractVMNode {
|
||||||
super(provider);
|
super(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "StandardProcessVMNode"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
public void update(IChildrenUpdate[] updates) {
|
public void update(IChildrenUpdate[] updates) {
|
||||||
for (IChildrenUpdate update : updates) {
|
for (IChildrenUpdate update : updates) {
|
||||||
ILaunch launch = findLaunch(update.getElementPath());
|
ILaunch launch = findLaunch(update.getElementPath());
|
||||||
|
|
|
@ -49,10 +49,16 @@ public class ModulesVMNode extends AbstractDMVMNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ModulesVMNode(AbstractDMVMProvider provider, DsfSession session) {
|
public ModulesVMNode(AbstractDMVMProvider provider, DsfSession session) {
|
||||||
super(provider, session, IModuleDMContext.class);
|
super(provider, session, IModuleDMContext.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ModulesVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
|
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
|
||||||
IModules modulesService = getServicesTracker().getService(IModules.class);
|
IModules modulesService = getServicesTracker().getService(IModules.class);
|
||||||
|
|
|
@ -159,6 +159,12 @@ public class RegisterBitFieldVMNode extends AbstractExpressionVMNode
|
||||||
fFormattedPrefStore = prefStore;
|
fFormattedPrefStore = prefStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RegisterBitFieldVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
public IFormattedValuePreferenceStore getPreferenceStore() {
|
public IFormattedValuePreferenceStore getPreferenceStore() {
|
||||||
return fFormattedPrefStore;
|
return fFormattedPrefStore;
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,7 +133,12 @@ public class RegisterGroupVMNode extends AbstractExpressionVMNode
|
||||||
super(provider, session, IRegisters.IRegisterGroupDMContext.class);
|
super(provider, session, IRegisters.IRegisterGroupDMContext.class);
|
||||||
fSyncRegisterDataAccess = syncDataAccess;
|
fSyncRegisterDataAccess = syncDataAccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RegisterGroupVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
public SyncRegisterDataAccess getSyncRegisterDataAccess() {
|
public SyncRegisterDataAccess getSyncRegisterDataAccess() {
|
||||||
return fSyncRegisterDataAccess;
|
return fSyncRegisterDataAccess;
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,11 @@ public class RegisterVMNode extends AbstractExpressionVMNode
|
||||||
fFormattedPrefStore = prefStore;
|
fFormattedPrefStore = prefStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RegisterVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
protected SyncRegisterDataAccess getSyncRegisterDataAccess() {
|
protected SyncRegisterDataAccess getSyncRegisterDataAccess() {
|
||||||
return fSyncRegisterDataAccess;
|
return fSyncRegisterDataAccess;
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,6 +198,11 @@ public class VariableVMNode extends AbstractExpressionVMNode
|
||||||
fSyncVariableDataAccess = syncVariableDataAccess;
|
fSyncVariableDataAccess = syncVariableDataAccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "VariableVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IDMVMContext createVMContext(IDMContext dmc) {
|
protected IDMVMContext createVMContext(IDMContext dmc) {
|
||||||
return new VariableExpressionVMC(dmc);
|
return new VariableExpressionVMC(dmc);
|
||||||
|
|
|
@ -367,7 +367,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
// Optimization: Try to find a delta with a matching element, if found use it.
|
// Optimization: Try to find a delta with a matching element, if found use it.
|
||||||
// Otherwise create a new delta for the event element.
|
// Otherwise create a new delta for the event element.
|
||||||
int elementIndex = nodeOffset + i;
|
int elementIndex = nodeOffset + i;
|
||||||
VMDelta delta = (VMDelta)parentDelta.getChildDelta(vmc);
|
VMDelta delta = parentDelta.getChildDelta(vmc);
|
||||||
if (delta == null || delta.getIndex() != elementIndex) {
|
if (delta == null || delta.getIndex() != elementIndex) {
|
||||||
delta = parentDelta.addNode(vmc, elementIndex, IModelDelta.NO_CHANGE);
|
delta = parentDelta.addNode(vmc, elementIndex, IModelDelta.NO_CHANGE);
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
for (IVMContext vmc : vmcs) {
|
for (IVMContext vmc : vmcs) {
|
||||||
// Optimization: Try to find a delta with a matching element, if found use it.
|
// Optimization: Try to find a delta with a matching element, if found use it.
|
||||||
// Otherwise create a new delta for the event element.
|
// Otherwise create a new delta for the event element.
|
||||||
VMDelta delta = (VMDelta)parentDelta.getChildDelta(vmc);
|
VMDelta delta = parentDelta.getChildDelta(vmc);
|
||||||
if (delta == null) {
|
if (delta == null) {
|
||||||
delta = parentDelta.addNode(vmc, IModelDelta.NO_CHANGE);
|
delta = parentDelta.addNode(vmc, IModelDelta.NO_CHANGE);
|
||||||
}
|
}
|
||||||
|
@ -458,8 +458,10 @@ public class DefaultVMModelProxyStrategy implements IVMModelProxy {
|
||||||
// and then call all the child nodes to build their delta.
|
// and then call all the child nodes to build their delta.
|
||||||
for (int i = 0; i < getData().size(); i++) {
|
for (int i = 0; i < getData().size(); i++) {
|
||||||
int elementIndex = nodeOffset >= 0 ? nodeOffset + i : -1;
|
int elementIndex = nodeOffset >= 0 ? nodeOffset + i : -1;
|
||||||
VMDelta delta =
|
VMDelta delta= parentDelta.getChildDelta(getData().get(i));
|
||||||
parentDelta.addNode(getData().get(i), elementIndex, IModelDelta.NO_CHANGE);
|
if (delta == null) {
|
||||||
|
delta= parentDelta.addNode(getData().get(i), elementIndex, IModelDelta.NO_CHANGE);
|
||||||
|
}
|
||||||
callChildNodesToBuildDelta(
|
callChildNodesToBuildDelta(
|
||||||
node, childNodesWithDeltaFlags, delta, event,
|
node, childNodesWithDeltaFlags, delta, event,
|
||||||
elementsDeltasMultiRequestMon.add(new RequestMonitor(getVMProvider().getExecutor(), null) {
|
elementsDeltasMultiRequestMon.add(new RequestMonitor(getVMProvider().getExecutor(), null) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2006 IBM Corporation and others.
|
* Copyright (c) 2005, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -195,6 +195,25 @@ public class VMDelta extends ModelDelta {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the child delta for the given element, or <code>null</code> if none.
|
||||||
|
*
|
||||||
|
* @param element child element
|
||||||
|
* @return corresponding delta node, or <code>null</code>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public VMDelta getChildDelta(Object element) {
|
||||||
|
if (fNodes != null) {
|
||||||
|
for (int i = 0; i < fNodes.length; i++) {
|
||||||
|
VMDelta delta = fNodes[i];
|
||||||
|
if (element.equals(delta.getElement())) {
|
||||||
|
return delta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the parent delta of this delta
|
* Sets the parent delta of this delta
|
||||||
*
|
*
|
||||||
|
|
|
@ -35,6 +35,12 @@ public class RootDMVMNode extends RootVMNode
|
||||||
super(provider);
|
super(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "RootDMVMNode"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the input object is a Data Model context, and the event is a DMC event.
|
* If the input object is a Data Model context, and the event is a DMC event.
|
||||||
* Then we can filter the event to make sure that the view does not
|
* Then we can filter the event to make sure that the view does not
|
||||||
|
|
|
@ -20,7 +20,6 @@ import java.util.Map;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
|
||||||
import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.CountingRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
||||||
|
@ -79,7 +78,8 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return fViewerInput + "." + fPath.toString() + "(" + fNode + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
return fNode.toString() + " " + //$NON-NLS-1$
|
||||||
|
(fPath.getSegmentCount() == 0 ? fViewerInput.toString() : fPath.getLastSegment().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -183,6 +183,12 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return fElementTester.toString() + " " + fRootElement.toString(); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -197,11 +203,6 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
fRootElement = rootElement;
|
fRootElement = rootElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Root marker for " + fRootElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
return obj instanceof RootElementMarkerKey && ((RootElementMarkerKey)obj).fRootElement.equals(fRootElement);
|
return obj instanceof RootElementMarkerKey && ((RootElementMarkerKey)obj).fRootElement.equals(fRootElement);
|
||||||
|
@ -211,6 +212,11 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return fRootElement.hashCode();
|
return fRootElement.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return fRootElement.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RootElementMarkerEntry extends Entry {
|
class RootElementMarkerEntry extends Entry {
|
||||||
|
@ -223,6 +229,11 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
super.remove();
|
super.remove();
|
||||||
rootElementRemovedFromCache(((RootElementMarkerKey)fKey).fRootElement);
|
rootElementRemovedFromCache(((RootElementMarkerKey)fKey).fRootElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ROOT MARKER " + fKey; //$NON-NLS-1$
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static String SELECTED_UPDATE_MODE = "org.eclipse.dd.dsf.ui.viewmodel.update.selectedUpdateMode"; //$NON-NLS-1$
|
protected static String SELECTED_UPDATE_MODE = "org.eclipse.dd.dsf.ui.viewmodel.update.selectedUpdateMode"; //$NON-NLS-1$
|
||||||
|
@ -251,7 +262,12 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
public AbstractCachingVMProvider(AbstractVMAdapter adapter, IPresentationContext presentationContext) {
|
public AbstractCachingVMProvider(AbstractVMAdapter adapter, IPresentationContext presentationContext) {
|
||||||
super(adapter, presentationContext);
|
super(adapter, presentationContext);
|
||||||
|
|
||||||
fCacheListHead = new Entry(null);
|
fCacheListHead = new Entry(null) {
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "HEAD"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
};
|
||||||
fCacheListHead.fNext = fCacheListHead;
|
fCacheListHead.fNext = fCacheListHead;
|
||||||
fCacheListHead.fPrevious = fCacheListHead;
|
fCacheListHead.fPrevious = fCacheListHead;
|
||||||
|
|
||||||
|
@ -703,10 +719,10 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
|
|
||||||
ElementDataKey key = makeEntryKey(node, update);
|
ElementDataKey key = makeEntryKey(node, update);
|
||||||
final ElementDataEntry entry = getElementDataEntry(key);
|
final ElementDataEntry entry = getElementDataEntry(key);
|
||||||
if (entry.fDirty) {
|
/*if (entry.fDirty) {
|
||||||
rm.setStatus(Status.CANCEL_STATUS);
|
rm.setStatus(Status.CANCEL_STATUS);
|
||||||
rm.done();
|
rm.done();
|
||||||
} else {
|
} else */{
|
||||||
Object dataOrStatus = entry.fDataOrStatus.get(dmc);
|
Object dataOrStatus = entry.fDataOrStatus.get(dmc);
|
||||||
if(dataOrStatus != null) {
|
if(dataOrStatus != null) {
|
||||||
if (dataOrStatus instanceof IDMData) {
|
if (dataOrStatus instanceof IDMData) {
|
||||||
|
|
|
@ -29,6 +29,11 @@ public class AutomaticUpdatePolicy implements IVMUpdatePolicy {
|
||||||
public boolean includes(IElementUpdateTester tester) {
|
public boolean includes(IElementUpdateTester tester) {
|
||||||
return tester.equals(this);
|
return tester.equals(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Autoamtic update tester"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public String getID() {
|
public String getID() {
|
||||||
|
|
|
@ -49,6 +49,11 @@ public class ManualUpdatePolicy implements IVMUpdatePolicy {
|
||||||
tester instanceof UserEditEventUpdateTester &&
|
tester instanceof UserEditEventUpdateTester &&
|
||||||
fElements.equals(((UserEditEventUpdateTester)tester).fElements);
|
fElements.equals(((UserEditEventUpdateTester)tester).fElements);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Edit (" + fElements + ") update tester"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IElementUpdateTester fgUpdateTester = new IElementUpdateTester() {
|
private static IElementUpdateTester fgUpdateTester = new IElementUpdateTester() {
|
||||||
|
@ -59,6 +64,11 @@ public class ManualUpdatePolicy implements IVMUpdatePolicy {
|
||||||
public boolean includes(IElementUpdateTester tester) {
|
public boolean includes(IElementUpdateTester tester) {
|
||||||
return tester.equals(this);
|
return tester.equals(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Manual (refresh = false) update tester"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private static IElementUpdateTester fgRefreshUpdateTester = new IElementUpdateTester() {
|
private static IElementUpdateTester fgRefreshUpdateTester = new IElementUpdateTester() {
|
||||||
|
@ -69,6 +79,11 @@ public class ManualUpdatePolicy implements IVMUpdatePolicy {
|
||||||
public boolean includes(IElementUpdateTester tester) {
|
public boolean includes(IElementUpdateTester tester) {
|
||||||
return tester.equals(this) || tester.equals(fgUpdateTester) || tester instanceof UserEditEventUpdateTester;
|
return tester.equals(this) || tester.equals(fgUpdateTester) || tester instanceof UserEditEventUpdateTester;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Manual (refresh = true) update tester"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public String getID() {
|
public String getID() {
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2008 Wind River Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Wind River Systems - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.dd.dsf.ui.viewmodel.update;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An update policy decorator which can override behaviour of an underlying update policy.
|
||||||
|
*/
|
||||||
|
public abstract class UpdatePolicyDecorator implements IVMUpdatePolicy {
|
||||||
|
|
||||||
|
private final IVMUpdatePolicy fBasePolicy;
|
||||||
|
|
||||||
|
protected UpdatePolicyDecorator(IVMUpdatePolicy base) {
|
||||||
|
fBasePolicy= base;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected final IVMUpdatePolicy getBaseUpdatePolicy() {
|
||||||
|
return fBasePolicy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final String getID() {
|
||||||
|
return fBasePolicy.getID();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return fBasePolicy.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IElementUpdateTester getElementUpdateTester(Object event) {
|
||||||
|
return fBasePolicy.getElementUpdateTester(event);
|
||||||
|
}
|
||||||
|
}
|
|
@ -61,6 +61,12 @@ class FileVMNode
|
||||||
fProvider = provider;
|
fProvider = provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "FileVMNode";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
// All resources garbage collected.
|
// All resources garbage collected.
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,11 @@ class FilesystemRootsVMNode extends AbstractVMNode
|
||||||
super(provider);
|
super(provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "FilesystemRootsVMNode";
|
||||||
|
}
|
||||||
|
|
||||||
public void update(final IChildrenUpdate[] updates) {
|
public void update(final IChildrenUpdate[] updates) {
|
||||||
new Job("") { //$NON-NLS-1$
|
new Job("") { //$NON-NLS-1$
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,6 +41,12 @@ class AlarmsVMNode extends AbstractDMVMNode
|
||||||
super(provider, session, AlarmDMContext.class);
|
super(provider, session, AlarmDMContext.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AlarmsVMNode(" + getSession().getId() + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
|
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
|
||||||
// Check that the service is available and find the trigger and timer contexts.
|
// Check that the service is available and find the trigger and timer contexts.
|
||||||
|
|
|
@ -78,6 +78,11 @@ class TimersVMNode extends AbstractDMVMNode
|
||||||
super(provider, session, TimerDMContext.class);
|
super(provider, session, TimerDMContext.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TimersVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
public void update(ILabelUpdate[] updates) {
|
public void update(ILabelUpdate[] updates) {
|
||||||
fgLabelProvider.update(updates);
|
fgLabelProvider.update(updates);
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,11 @@ class TriggersVMNode extends AbstractDMVMNode
|
||||||
super(provider, session, TriggerDMContext.class);
|
super(provider, session, TriggerDMContext.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "TriggersVMNode(" + getSession().getId() + ")";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
|
protected void updateElementsInSessionThread(final IChildrenUpdate update) {
|
||||||
AlarmService alarmService = getServicesTracker().getService(AlarmService.class, null);
|
AlarmService alarmService = getServicesTracker().getService(AlarmService.class, null);
|
||||||
|
|
|
@ -17,6 +17,7 @@ import java.util.Map;
|
||||||
import org.eclipse.core.runtime.IAdapterFactory;
|
import org.eclipse.core.runtime.IAdapterFactory;
|
||||||
import org.eclipse.dd.dsf.concurrent.Immutable;
|
import org.eclipse.dd.dsf.concurrent.Immutable;
|
||||||
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
||||||
|
import org.eclipse.dd.dsf.debug.internal.provisional.ui.viewmodel.launch.DefaultDsfModelSelectionPolicyFactory;
|
||||||
import org.eclipse.dd.dsf.debug.ui.actions.DsfResumeCommand;
|
import org.eclipse.dd.dsf.debug.ui.actions.DsfResumeCommand;
|
||||||
import org.eclipse.dd.dsf.debug.ui.actions.DsfStepIntoCommand;
|
import org.eclipse.dd.dsf.debug.ui.actions.DsfStepIntoCommand;
|
||||||
import org.eclipse.dd.dsf.debug.ui.actions.DsfStepOverCommand;
|
import org.eclipse.dd.dsf.debug.ui.actions.DsfStepOverCommand;
|
||||||
|
@ -42,6 +43,7 @@ import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
|
||||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
|
import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
|
||||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
|
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
|
||||||
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
|
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
|
||||||
|
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicyFactory;
|
||||||
import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
|
import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,6 +84,8 @@ public class PDAAdapterFactory implements IAdapterFactory, ILaunchesListener2
|
||||||
final IDebugModelProvider fDebugModelProvider;
|
final IDebugModelProvider fDebugModelProvider;
|
||||||
final PDALaunch fLaunch;
|
final PDALaunch fLaunch;
|
||||||
|
|
||||||
|
private IModelSelectionPolicyFactory fModelSelectionPolicyFactory;
|
||||||
|
|
||||||
LaunchAdapterSet(PDALaunch launch) {
|
LaunchAdapterSet(PDALaunch launch) {
|
||||||
// Initialize launch and session.
|
// Initialize launch and session.
|
||||||
fLaunch = launch;
|
fLaunch = launch;
|
||||||
|
@ -93,6 +97,10 @@ public class PDAAdapterFactory implements IAdapterFactory, ILaunchesListener2
|
||||||
// Initialize source lookup
|
// Initialize source lookup
|
||||||
fSourceDisplayAdapter = new DsfSourceDisplayAdapter(session, (ISourceLookupDirector)launch.getSourceLocator());
|
fSourceDisplayAdapter = new DsfSourceDisplayAdapter(session, (ISourceLookupDirector)launch.getSourceLocator());
|
||||||
session.registerModelAdapter(ISourceDisplay.class, fSourceDisplayAdapter);
|
session.registerModelAdapter(ISourceDisplay.class, fSourceDisplayAdapter);
|
||||||
|
|
||||||
|
// Default selection policy
|
||||||
|
fModelSelectionPolicyFactory = new DefaultDsfModelSelectionPolicyFactory();
|
||||||
|
session.registerModelAdapter(IModelSelectionPolicyFactory.class, fModelSelectionPolicyFactory);
|
||||||
|
|
||||||
// Initialize retargetable command handler.
|
// Initialize retargetable command handler.
|
||||||
fStepIntoCommand = new DsfStepIntoCommand(session, null);
|
fStepIntoCommand = new DsfStepIntoCommand(session, null);
|
||||||
|
@ -130,6 +138,8 @@ public class PDAAdapterFactory implements IAdapterFactory, ILaunchesListener2
|
||||||
session.unregisterModelAdapter(ISourceDisplay.class);
|
session.unregisterModelAdapter(ISourceDisplay.class);
|
||||||
if (fSourceDisplayAdapter != null) fSourceDisplayAdapter.dispose();
|
if (fSourceDisplayAdapter != null) fSourceDisplayAdapter.dispose();
|
||||||
|
|
||||||
|
session.unregisterModelAdapter(IModelSelectionPolicyFactory.class);
|
||||||
|
|
||||||
session.unregisterModelAdapter(IStepIntoHandler.class);
|
session.unregisterModelAdapter(IStepIntoHandler.class);
|
||||||
session.unregisterModelAdapter(IStepOverHandler.class);
|
session.unregisterModelAdapter(IStepOverHandler.class);
|
||||||
session.unregisterModelAdapter(IStepReturnHandler.class);
|
session.unregisterModelAdapter(IStepReturnHandler.class);
|
||||||
|
|
|
@ -44,6 +44,10 @@ public class PDAThreadsVMNode extends AbstractThreadVMNode
|
||||||
super(provider, session);
|
super(provider, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PDAThreadVMNode(" + getSession().getId() + ")";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateLabelInSessionThread(ILabelUpdate[] updates) {
|
protected void updateLabelInSessionThread(ILabelUpdate[] updates) {
|
||||||
|
@ -65,44 +69,47 @@ public class PDAThreadsVMNode extends AbstractThreadVMNode
|
||||||
update.setImageDescriptor(DebugUITools.getImageDescriptor(imageKey), 0);
|
update.setImageDescriptor(DebugUITools.getImageDescriptor(imageKey), 0);
|
||||||
|
|
||||||
// Find the Reason for the State
|
// Find the Reason for the State
|
||||||
runControl.getExecutionData(dmc,
|
getDMVMProvider().getModelData(
|
||||||
new ViewerDataRequestMonitor<IExecutionDMData>(getSession().getExecutor(), update) {
|
this, update, runControl, dmc,
|
||||||
@Override
|
new ViewerDataRequestMonitor<IExecutionDMData>(getSession().getExecutor(), update) {
|
||||||
public void handleCompleted(){
|
@Override
|
||||||
if (!isSuccess()) {
|
public void handleCompleted(){
|
||||||
handleFailedUpdate(update);
|
if (!isSuccess()) {
|
||||||
return;
|
update.setLabel("<unavailable>", 0);
|
||||||
}
|
update.done();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// We're in a new dispatch cycle, and we have to check whether the
|
// We're in a new dispatch cycle, and we have to check whether the
|
||||||
// service reference is still valid.
|
// service reference is still valid.
|
||||||
final PDARunControl runControl = getServicesTracker().getService(PDARunControl.class);
|
final PDARunControl runControl = getServicesTracker().getService(PDARunControl.class);
|
||||||
if ( runControl == null ) {
|
if ( runControl == null ) {
|
||||||
handleFailedUpdate(update);
|
handleFailedUpdate(update);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final StateChangeReason reason = getData().getStateChangeReason();
|
final StateChangeReason reason = getData().getStateChangeReason();
|
||||||
|
|
||||||
// Create Labels of type Thread[GDBthreadId]RealThreadID/Name (State: Reason)
|
// Create Labels of type Thread[GDBthreadId]RealThreadID/Name (State: Reason)
|
||||||
// Thread[1] 3457 (Suspended:BREAKPOINT)
|
// Thread[1] 3457 (Suspended:BREAKPOINT)
|
||||||
final StringBuilder builder = new StringBuilder();
|
final StringBuilder builder = new StringBuilder();
|
||||||
builder.append("Thread ");
|
builder.append("Thread ");
|
||||||
builder.append(dmc.getID());
|
builder.append(dmc.getID());
|
||||||
if(getServicesTracker().getService(IRunControl.class).isSuspended(dmc))
|
if(getServicesTracker().getService(IRunControl.class).isSuspended(dmc))
|
||||||
builder.append(" (Suspended");
|
builder.append(" (Suspended");
|
||||||
else
|
else
|
||||||
builder.append(" (Running");
|
builder.append(" (Running");
|
||||||
// Reason will be null before ContainerSuspendEvent is fired
|
// Reason will be null before ContainerSuspendEvent is fired
|
||||||
if(reason != null) {
|
if(reason != null) {
|
||||||
builder.append(" : ");
|
builder.append(" : ");
|
||||||
builder.append(reason);
|
builder.append(reason);
|
||||||
}
|
}
|
||||||
builder.append(")");
|
builder.append(")");
|
||||||
update.setLabel(builder.toString(), 0);
|
update.setLabel(builder.toString(), 0);
|
||||||
update.done();
|
update.done();
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
getExecutor());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,12 +46,16 @@ import org.eclipse.ui.IMemento;
|
||||||
public class PDAVirtualMachineVMNode extends AbstractContainerVMNode
|
public class PDAVirtualMachineVMNode extends AbstractContainerVMNode
|
||||||
implements IElementMementoProvider
|
implements IElementMementoProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public PDAVirtualMachineVMNode(AbstractDMVMProvider provider, DsfSession session) {
|
public PDAVirtualMachineVMNode(AbstractDMVMProvider provider, DsfSession session) {
|
||||||
super(provider, session);
|
super(provider, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PDAContainerVMNode(" + getSession().getId() + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateElementsInSessionThread(IChildrenUpdate update) {
|
protected void updateElementsInSessionThread(IChildrenUpdate update) {
|
||||||
// Get the instance of the service. Note that there is no race condition
|
// Get the instance of the service. Note that there is no race condition
|
||||||
|
@ -97,8 +101,8 @@ public class PDAVirtualMachineVMNode extends AbstractContainerVMNode
|
||||||
update.setImageDescriptor(DebugUITools.getImageDescriptor(imageKey), 0);
|
update.setImageDescriptor(DebugUITools.getImageDescriptor(imageKey), 0);
|
||||||
|
|
||||||
// Retrieve the last state change reason
|
// Retrieve the last state change reason
|
||||||
runControl.getExecutionData(
|
getDMVMProvider().getModelData(
|
||||||
programCtx,
|
this, update, runControl, programCtx,
|
||||||
new ViewerDataRequestMonitor<IExecutionDMData>(ImmediateExecutor.getInstance(), update)
|
new ViewerDataRequestMonitor<IExecutionDMData>(ImmediateExecutor.getInstance(), update)
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@ -130,31 +134,10 @@ public class PDAVirtualMachineVMNode extends AbstractContainerVMNode
|
||||||
update.setLabel(builder.toString(), 0);
|
update.setLabel(builder.toString(), 0);
|
||||||
update.done();
|
update.done();
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
getExecutor());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @Override
|
|
||||||
public int getDeltaFlags(Object e) {
|
|
||||||
if (e instanceof PDAStartedEvent) {
|
|
||||||
return IModelDelta.EXPAND | IModelDelta.SELECT;
|
|
||||||
}
|
|
||||||
return super.getDeltaFlags(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void buildDelta(Object e, final VMDelta parentDelta, final int nodeOffset, final RequestMonitor rm) {
|
|
||||||
if (e instanceof PDAStartedEvent) {
|
|
||||||
// When debug session is started expand and select the program.
|
|
||||||
// If the program hits a breakpoint, the top stack frame will then
|
|
||||||
// be selected.
|
|
||||||
parentDelta.addNode(createVMContext(((PDAStartedEvent)e).getDMContext()), IModelDelta.EXPAND | IModelDelta.SELECT);
|
|
||||||
rm.done();
|
|
||||||
} else {
|
|
||||||
super.buildDelta(e, parentDelta, nodeOffset, rm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String produceProgramElementName( String viewName , PDAVirtualMachineDMContext execCtx ) {
|
private String produceProgramElementName( String viewName , PDAVirtualMachineDMContext execCtx ) {
|
||||||
return "PDA." + execCtx.getProgram(); //$NON-NLS-1$
|
return "PDA." + execCtx.getProgram(); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
import org.eclipse.dd.dsf.concurrent.DsfRunnable;
|
||||||
|
import org.eclipse.dd.dsf.concurrent.IDsfStatusConstants;
|
||||||
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
import org.eclipse.dd.dsf.concurrent.RequestMonitor;
|
||||||
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
import org.eclipse.dd.dsf.concurrent.ThreadSafe;
|
||||||
import org.eclipse.dd.dsf.debug.service.command.ICommand;
|
import org.eclipse.dd.dsf.debug.service.command.ICommand;
|
||||||
|
@ -416,14 +417,26 @@ public class PDACommandControl extends AbstractDsfService implements ICommandCon
|
||||||
// Trace to debug output.
|
// Trace to debug output.
|
||||||
PDAPlugin.debug("R: " + response);
|
PDAPlugin.debug("R: " + response);
|
||||||
|
|
||||||
// Given the PDA response string, create the result using the command
|
PDACommandResult result = null;
|
||||||
// that was sent.
|
|
||||||
PDACommandResult result = handle.fCommand.createResult(response);
|
|
||||||
|
|
||||||
// Set the result to the request monitor and return to sender.
|
if (response.startsWith("error:")) {
|
||||||
// Note: as long as PDA sends some response, a PDA command will never
|
// Create a generic result with the error response
|
||||||
// return an error.
|
result = new PDACommandResult(response);
|
||||||
handle.fRequestMonitor.setData(result);
|
|
||||||
|
// Set the error status to the request monitor.
|
||||||
|
handle.fRequestMonitor.setStatus(new Status(
|
||||||
|
IStatus.ERROR, PDAPlugin.PLUGIN_ID,
|
||||||
|
IDsfStatusConstants.REQUEST_FAILED, response, null));
|
||||||
|
} else {
|
||||||
|
// Given the PDA response string, create the result using the command
|
||||||
|
// that was sent.
|
||||||
|
result = handle.fCommand.createResult(response);
|
||||||
|
|
||||||
|
// Set the result to the request monitor and return to sender.
|
||||||
|
// Note: as long as PDA sends some response, a PDA command will never
|
||||||
|
// return an error.
|
||||||
|
handle.fRequestMonitor.setData(result);
|
||||||
|
}
|
||||||
handle.fRequestMonitor.done();
|
handle.fRequestMonitor.done();
|
||||||
|
|
||||||
// Notify listeners of the response
|
// Notify listeners of the response
|
||||||
|
|
|
@ -45,11 +45,14 @@ import org.eclipse.ui.IMemento;
|
||||||
public class ContainerVMNode extends AbstractContainerVMNode
|
public class ContainerVMNode extends AbstractContainerVMNode
|
||||||
implements IElementMementoProvider
|
implements IElementMementoProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public ContainerVMNode(AbstractDMVMProvider provider, DsfSession session) {
|
public ContainerVMNode(AbstractDMVMProvider provider, DsfSession session) {
|
||||||
super(provider, session);
|
super(provider, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ContainerVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateElementsInSessionThread(IChildrenUpdate update) {
|
protected void updateElementsInSessionThread(IChildrenUpdate update) {
|
||||||
|
|
|
@ -41,6 +41,10 @@ public class ThreadVMNode extends AbstractThreadVMNode
|
||||||
super(provider, session);
|
super(provider, session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ThreadVMNode(" + getSession().getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateLabelInSessionThread(ILabelUpdate[] updates) {
|
protected void updateLabelInSessionThread(ILabelUpdate[] updates) {
|
||||||
|
@ -67,7 +71,8 @@ public class ThreadVMNode extends AbstractThreadVMNode
|
||||||
@Override
|
@Override
|
||||||
public void handleCompleted(){
|
public void handleCompleted(){
|
||||||
if (!isSuccess()) {
|
if (!isSuccess()) {
|
||||||
handleFailedUpdate(update);
|
update.setLabel("<unavailable>", 0); //$NON-NLS-1$
|
||||||
|
update.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue