Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2011-10-05 20:56:09 +0000
committerEugene Tarassov2011-10-05 20:56:09 +0000
commitf6f9934db820418b3211af08796a24359a049626 (patch)
tree8befec2afad7880c44e0cb6bca147819154d5d7a /plugins
parent351b1be9b9736254051e31a792925e795452cf45 (diff)
downloadorg.eclipse.tcf-f6f9934db820418b3211af08796a24359a049626.tar.gz
org.eclipse.tcf-f6f9934db820418b3211af08796a24359a049626.tar.xz
org.eclipse.tcf-f6f9934db820418b3211af08796a24359a049626.zip
TCF Debugger: added support for CDT Clone & Pin commands.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml1
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/TCFNodeAdapterFactory.java120
-rw-r--r--plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/commands/TCFPinViewCommand.java274
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java55
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java1
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java1
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java2
7 files changed, 372 insertions, 82 deletions
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml b/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml
index 22188885c..d62278837 100644
--- a/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/plugin.xml
@@ -30,6 +30,7 @@
<adapter type="org.eclipse.cdt.debug.core.model.IReverseStepOverHandler"/>
<adapter type="org.eclipse.cdt.debug.core.model.IReverseResumeHandler"/>
<adapter type="org.eclipse.cdt.debug.core.model.IUncallHandler"/>
+ <adapter type="org.eclipse.cdt.debug.ui.IPinProvider"/>
<adapter type="org.eclipse.cdt.debug.internal.core.ICWatchpointTarget"/>
<adapter type="org.eclipse.tm.internal.tcf.debug.ui.model.ISourceNotFoundPresentation"/>
</factory>
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/TCFNodeAdapterFactory.java b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/TCFNodeAdapterFactory.java
index d3a8c3306..7dcc42b2c 100644
--- a/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/TCFNodeAdapterFactory.java
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/TCFNodeAdapterFactory.java
@@ -18,10 +18,12 @@ import org.eclipse.cdt.debug.core.model.ISteppingModeTarget;
import org.eclipse.cdt.debug.core.model.IUncallHandler;
import org.eclipse.cdt.debug.internal.core.ICWatchpointTarget;
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend;
+import org.eclipse.cdt.debug.ui.IPinProvider;
import org.eclipse.cdt.ui.text.c.hover.ICEditorTextHover;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.debug.core.model.ISuspendResume;
import org.eclipse.tm.internal.tcf.cdt.ui.breakpoints.TCFWatchpointTarget;
+import org.eclipse.tm.internal.tcf.cdt.ui.commands.TCFPinViewCommand;
import org.eclipse.tm.internal.tcf.cdt.ui.commands.TCFReverseResumeCommand;
import org.eclipse.tm.internal.tcf.cdt.ui.commands.TCFReverseStepIntoCommand;
import org.eclipse.tm.internal.tcf.cdt.ui.commands.TCFReverseStepOverCommand;
@@ -36,7 +38,6 @@ import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNode;
import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNodeExecContext;
import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNodeExpression;
import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNodeStackFrame;
-import org.eclipse.tm.tcf.util.TCFTask;
@SuppressWarnings({ "rawtypes", "restriction" })
public class TCFNodeAdapterFactory implements IAdapterFactory {
@@ -51,85 +52,77 @@ public class TCFNodeAdapterFactory implements IAdapterFactory {
IReverseStepOverHandler.class,
IReverseResumeHandler.class,
IUncallHandler.class,
- ICWatchpointTarget.class
+ IPinProvider.class,
+ ICWatchpointTarget.class,
+ ISourceNotFoundPresentation.class
};
private static final TCFSourceNotFoundPresentation fgSourceNotFoundPresentation = new TCFSourceNotFoundPresentation();
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adaptableObject instanceof TCFNode) {
- final TCFNode node = (TCFNode) adaptableObject;
+ public Object getAdapter(Object obj, Class type) {
+ if (obj instanceof TCFNode) {
+ final TCFNode node = (TCFNode)obj;
TCFModel model = node.getModel();
- if (IDisassemblyBackend.class == adapterType) {
+ if (IDisassemblyBackend.class == type) {
TCFDisassemblyBackend backend = new TCFDisassemblyBackend();
- if (backend.supportsDebugContext((TCFNode) adaptableObject)) {
- return backend;
- }
- } else if (ISteppingModeTarget.class == adapterType) {
- ISteppingModeTarget target = (ISteppingModeTarget) model.getAdapter(adapterType, node);
- if (target == null) {
- model.setAdapter(adapterType, target = new TCFSteppingModeTarget(model));
- }
+ if (backend.supportsDebugContext((TCFNode)obj)) return backend;
+ }
+ else if (ISteppingModeTarget.class == type) {
+ ISteppingModeTarget target = (ISteppingModeTarget)model.getAdapter(type, node);
+ if (target == null) model.setAdapter(type, target = new TCFSteppingModeTarget(model));
return target;
- } else if (ISuspendResume.class == adapterType) {
- TCFNodeExecContext execCtx = null;
+ }
+ else if (ISuspendResume.class == type) {
+ TCFNodeExecContext exec = null;
if (node instanceof TCFNodeExecContext) {
- execCtx = (TCFNodeExecContext) node;
- } else if (node instanceof TCFNodeStackFrame) {
- execCtx = new TCFTask<TCFNodeExecContext>() {
- public void run() {
- if (node.getParent() instanceof TCFNodeExecContext) {
- done((TCFNodeExecContext) node.getParent());
- } else {
- done(null);
- }
- }
- }.getE();
+ exec = (TCFNodeExecContext)node;
}
- if (execCtx != null) {
- return new TCFSuspendResumeAdapter(execCtx);
+ else if (node instanceof TCFNodeStackFrame) {
+ exec = (TCFNodeExecContext)node.getParent();
}
- } else if (ICEditorTextHover.class == adapterType) {
- ICEditorTextHover hover = (ICEditorTextHover) model.getAdapter(adapterType, node);
- if (hover == null) {
- model.setAdapter(adapterType, hover = new TCFDebugTextHover());
+ if (exec != null) {
+ return new TCFSuspendResumeAdapter(exec);
}
+ }
+ else if (ICEditorTextHover.class == type) {
+ ICEditorTextHover hover = (ICEditorTextHover)model.getAdapter(type, node);
+ if (hover == null) model.setAdapter(type, hover = new TCFDebugTextHover());
return hover;
- } else if (IReverseToggleHandler.class == adapterType) {
- IReverseToggleHandler handler = (IReverseToggleHandler) model.getAdapter(adapterType, node);
- if (handler == null) {
- model.setAdapter(adapterType, handler = new TCFReverseToggleCommand());
- }
+ }
+ else if (IReverseToggleHandler.class == type) {
+ IReverseToggleHandler handler = (IReverseToggleHandler)model.getAdapter(type, node);
+ if (handler == null) model.setAdapter(type, handler = new TCFReverseToggleCommand());
return handler;
- } else if (IReverseStepIntoHandler.class == adapterType) {
- IReverseStepIntoHandler handler = (IReverseStepIntoHandler) model.getAdapter(adapterType, node);
- if (handler == null) {
- model.setAdapter(adapterType, handler = new TCFReverseStepIntoCommand(model));
- }
+ }
+ else if (IReverseStepIntoHandler.class == type) {
+ IReverseStepIntoHandler handler = (IReverseStepIntoHandler)model.getAdapter(type, node);
+ if (handler == null) model.setAdapter(type, handler = new TCFReverseStepIntoCommand(model));
return handler;
- } else if (IReverseStepOverHandler.class == adapterType) {
- IReverseStepOverHandler handler = (IReverseStepOverHandler) model.getAdapter(adapterType, node);
- if (handler == null) {
- model.setAdapter(adapterType, handler = new TCFReverseStepOverCommand(model));
- }
+ }
+ else if (IReverseStepOverHandler.class == type) {
+ IReverseStepOverHandler handler = (IReverseStepOverHandler)model.getAdapter(type, node);
+ if (handler == null) model.setAdapter(type, handler = new TCFReverseStepOverCommand(model));
return handler;
- } else if (IUncallHandler.class == adapterType) {
- IUncallHandler handler = (IUncallHandler) model.getAdapter(adapterType, node);
- if (handler == null) {
- model.setAdapter(adapterType, handler = new TCFReverseStepReturnCommand(model));
- }
+ }
+ else if (IUncallHandler.class == type) {
+ IUncallHandler handler = (IUncallHandler)model.getAdapter(type, node);
+ if (handler == null) model.setAdapter(type, handler = new TCFReverseStepReturnCommand(model));
return handler;
- } else if (IReverseResumeHandler.class == adapterType) {
- IReverseResumeHandler handler = (IReverseResumeHandler) model.getAdapter(adapterType, node);
- if (handler == null) {
- model.setAdapter(adapterType, handler = new TCFReverseResumeCommand(model));
- }
+ }
+ else if (IReverseResumeHandler.class == type) {
+ IReverseResumeHandler handler = (IReverseResumeHandler)model.getAdapter(type, node);
+ if (handler == null) model.setAdapter(type, handler = new TCFReverseResumeCommand(model));
return handler;
- } else if (ICWatchpointTarget.class == adapterType) {
- if (node instanceof TCFNodeExpression) {
- return new TCFWatchpointTarget((TCFNodeExpression) node);
- }
- } else if (ISourceNotFoundPresentation.class == adapterType) {
+ }
+ else if (IPinProvider.class == type) {
+ IPinProvider handler = (IPinProvider)model.getAdapter(type, node);
+ if (handler == null) model.setAdapter(type, handler = new TCFPinViewCommand(model));
+ return handler;
+ }
+ else if (ICWatchpointTarget.class == type) {
+ if (node instanceof TCFNodeExpression) return new TCFWatchpointTarget((TCFNodeExpression)node);
+ }
+ else if (ISourceNotFoundPresentation.class == type) {
return fgSourceNotFoundPresentation;
}
}
@@ -139,5 +132,4 @@ public class TCFNodeAdapterFactory implements IAdapterFactory {
public Class[] getAdapterList() {
return CLASSES;
}
-
}
diff --git a/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/commands/TCFPinViewCommand.java b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/commands/TCFPinViewCommand.java
new file mode 100644
index 000000000..24f72e72f
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.cdt.ui/src/org/eclipse/tm/internal/tcf/cdt/ui/commands/TCFPinViewCommand.java
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. 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.tm.internal.tcf.cdt.ui.commands;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+import org.eclipse.cdt.debug.ui.IPinProvider;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFModel;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNode;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNodeExecContext;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNodeStackFrame;
+import org.eclipse.tm.tcf.services.IRunControl;
+import org.eclipse.tm.tcf.util.TCFDataCache;
+import org.eclipse.tm.tcf.util.TCFTask;
+import org.eclipse.ui.IWorkbenchPart;
+
+@SuppressWarnings("restriction")
+public class TCFPinViewCommand implements IPinProvider {
+
+ private final TCFModel model;
+ private final ArrayList<PinnedView> list = new ArrayList<PinnedView>();
+
+ private class PinnedView implements IPinElementHandle {
+
+ @SuppressWarnings("unused")
+ private final IPinModelListener listener;
+ @SuppressWarnings("unused")
+ private final IWorkbenchPart part;
+ private final TCFNode node;
+ private final IPresentationContext ctx;
+
+ final IRunControl.RunControlListener rc_listener = new IRunControl.RunControlListener() {
+
+ public void contextAdded(IRunControl.RunControlContext[] contexts) {
+ }
+
+ public void contextChanged(IRunControl.RunControlContext[] contexts) {
+ for (IRunControl.RunControlContext ctx : contexts) {
+ if (node.getID().equals(ctx.getID())) updateLabel();
+ }
+ }
+
+ public void contextRemoved(String[] context_ids) {
+ for (String id : context_ids) {
+ if (node.getID().equals(id)) updateLabel();
+ }
+ }
+
+ public void contextSuspended(String id, String pc, String reason, Map<String, Object> params) {
+ if (node.getID().equals(id)) updateLabel();
+ }
+
+ public void contextResumed(String id) {
+ if (node.getID().equals(id)) updateLabel();
+ }
+
+ public void containerSuspended(String context, String pc, String reason, Map<String, Object> params, String[] suspended_ids) {
+ for (String id : suspended_ids) {
+ if (node.getID().equals(id)) updateLabel();
+ }
+ }
+
+ public void containerResumed(String[] context_ids) {
+ for (String id : context_ids) {
+ if (node.getID().equals(id)) updateLabel();
+ }
+ }
+
+ public void contextException(String id, String msg) {
+ if (node.getID().equals(id)) updateLabel();
+ }
+ };
+
+ PinnedView(IWorkbenchPart part, TCFNode node, IPinModelListener listener) {
+ this.part = part;
+ this.node = node;
+ this.listener = listener;
+ ctx = new PresentationContext(TCFModel.ID_PINNED_VIEW, part);
+ IRunControl rc = model.getChannel().getRemoteService(IRunControl.class);
+ if (rc != null) rc.addListener(rc_listener);
+ }
+
+ void updateLabel() {
+ // TODO: CDT does not support label update
+ /*
+ model.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ listener.modelChanged(new StructuredSelection(node));
+ }
+ });
+ */
+ }
+
+ void dispose() {
+ IRunControl rc = model.getChannel().getRemoteService(IRunControl.class);
+ if (rc != null) rc.removeListener(rc_listener);
+ }
+
+ public Object getDebugContext() {
+ return node;
+ }
+
+ public String getLabel() {
+ return new TCFTask<String>() {
+ public void run() {
+ model.update(new ILabelUpdate[]{ new ILabelUpdate() {
+
+ String text;
+
+ public IPresentationContext getPresentationContext() {
+ return ctx;
+ }
+
+ public Object getElement() {
+ return node;
+ }
+
+ public TreePath getElementPath() {
+ return null;
+ }
+
+ public Object getViewerInput() {
+ return null;
+ }
+
+ public void setStatus(IStatus status) {
+ }
+
+ public IStatus getStatus() {
+ return null;
+ }
+
+ public void done() {
+ done_update(text);
+ }
+
+ public void cancel() {
+ }
+
+ public boolean isCanceled() {
+ return false;
+ }
+
+ public String[] getColumnIds() {
+ return null;
+ }
+
+ public void setLabel(String text, int columnIndex) {
+ if (columnIndex == 0) this.text = text;
+ }
+
+ public void setFontData(FontData fontData, int columnIndex) {
+ }
+
+ public void setImageDescriptor(ImageDescriptor image, int columnIndex) {
+ }
+
+ public void setForeground(RGB foreground, int columnIndex) {
+ }
+
+ public void setBackground(RGB background, int columnIndex) {
+ }
+ }});
+ }
+
+ private void done_update(String text) {
+ if (text == null) text = node.getID();
+ done(text);
+ }
+ }.getE();
+ }
+
+ public IPinElementColorDescriptor getPinElementColorDescriptor() {
+ return null;
+ }
+ }
+
+ public TCFPinViewCommand(TCFModel model) {
+ this.model = model;
+ }
+
+ public boolean isPinnable(IWorkbenchPart part, final Object obj) {
+ if (obj instanceof TCFNode) {
+ try {
+ final String id = part.getSite().getId();
+ return new TCFTask<Boolean>(model.getChannel()) {
+ public void run() {
+ boolean mem = false;
+ boolean vars = false;
+ if (obj instanceof TCFNodeExecContext) {
+ TCFNodeExecContext node = (TCFNodeExecContext)obj;
+ TCFDataCache<IRunControl.RunControlContext> ctx_cache = node.getRunContext();
+ if (!ctx_cache.validate(this)) return;
+ IRunControl.RunControlContext ctx_data = ctx_cache.getData();
+ if (ctx_data != null) {
+ vars = ctx_data.hasState();
+ mem = vars || ctx_data.getProcessID() != null;
+ }
+ }
+ if (obj instanceof TCFNodeStackFrame) {
+ vars = true;
+ mem = true;
+ }
+ if (IDebugUIConstants.ID_REGISTER_VIEW.equals(id)) done(vars);
+ else if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(id)) done(vars);
+ else if (IDebugUIConstants.ID_EXPRESSION_VIEW.equals(id)) done(mem);
+ else done(false);
+ }
+ }.getE();
+ }
+ catch (Throwable x) {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ public IPinElementHandle pin(final IWorkbenchPart part, Object obj, final IPinModelListener listener) {
+ if (obj instanceof TCFNode) {
+ final TCFNode node = (TCFNode)obj;
+ return new TCFTask<IPinElementHandle>() {
+ public void run() {
+ PinnedView p = new PinnedView(part, node, listener);
+ model.setPin(part, node);
+ list.add(p);
+ done(p);
+ }
+ }.getE();
+ }
+ return null;
+ }
+
+ public void unpin(final IWorkbenchPart part, final IPinElementHandle handle) {
+ new TCFTask<Object>() {
+ public void run() {
+ model.setPin(part, null);
+ if (list.remove(handle)) {
+ ((PinnedView)handle).dispose();
+ }
+ done(null);
+ }
+ };
+ }
+
+ public boolean isPinnedTo(Object obj, final IPinElementHandle handle) {
+ if (obj instanceof TCFNode) {
+ return new TCFTask<Boolean>() {
+ public void run() {
+ done(list.contains(handle));
+ }
+ }.getE();
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
index 0cf37420d..44f33f1d8 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
@@ -120,6 +120,7 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IPersistableElement;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
@@ -138,6 +139,9 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
/** The id of the expression hover presentation context */
public static final String ID_EXPRESSION_HOVER = Activator.PLUGIN_ID + ".expression_hover";
+ /** The id of a pinned view description presentation context */
+ public static final String ID_PINNED_VIEW = Activator.PLUGIN_ID + ".pinned_view";
+
/**
* A dummy editor input to open the disassembly view as editor.
*/
@@ -269,6 +273,8 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
private final Set<String> expanded_nodes = new HashSet<String>();
+ private final Map<IWorkbenchPart,TCFNode> pins = new HashMap<IWorkbenchPart,TCFNode>();
+
private TCFConsole console;
private static final Map<ILaunchConfiguration,IEditorInput> editor_not_found =
@@ -1261,23 +1267,34 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
}
}
- public void update(IViewerInputUpdate update) {
- if (IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(update.getPresentationContext().getId())) {
- // Current implementation does not support flexible hierarchy for breakpoints
- IViewerInputProvider p = (IViewerInputProvider)launch.getAdapter(IViewerInputProvider.class);
- if (p != null) {
- p.update(update);
- return;
+ public void update(final IViewerInputUpdate update) {
+ Protocol.invokeLater(new Runnable() {
+ public void run() {
+ TCFNode node = pins.get(update.getPresentationContext().getPart());
+ if (node != null) {
+ update.setInputElement(node);
+ update.done();
+ }
+ else {
+ if (IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(update.getPresentationContext().getId())) {
+ // Current implementation does not support flexible hierarchy for breakpoints
+ IViewerInputProvider p = (IViewerInputProvider)launch.getAdapter(IViewerInputProvider.class);
+ if (p != null) {
+ p.update(update);
+ return;
+ }
+ }
+ Object o = update.getElement();
+ if (o instanceof TCFLaunch) {
+ update.setInputElement(o);
+ update.done();
+ }
+ else {
+ ((TCFNode)o).update(update);
+ }
+ }
}
- }
- Object o = update.getElement();
- if (o instanceof TCFLaunch) {
- update.setInputElement(o);
- update.done();
- }
- else {
- ((TCFNode)o).update(update);
- }
+ });
}
public IModelProxy createModelProxy(Object element, IPresentationContext context) {
@@ -1312,6 +1329,12 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
return null;
}
+ public void setPin(IWorkbenchPart part, TCFNode node) {
+ assert Protocol.isDispatchThread();
+ if (node == null) pins.remove(part);
+ else pins.put(part, node);
+ }
+
public void setDebugViewSelection(TCFNode node, String reason) {
assert Protocol.isDispatchThread();
if (node == null) return;
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
index d4f346eee..9a5f09b9f 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
@@ -43,6 +43,7 @@ import org.eclipse.tm.tcf.protocol.Protocol;
* fires deltas to notify listeners of changes in the model.
* Model proxy listeners are debuggers views.
*/
+@SuppressWarnings("restriction")
public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Runnable {
private static final TCFNode[] EMPTY_NODE_ARRAY = new TCFNode[0];
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
index df1e661b1..875308309 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
@@ -193,7 +193,6 @@ public abstract class TCFNode extends PlatformObject implements Comparable<TCFNo
* @return parent node or null if the node is a root
*/
public final TCFNode getParent() {
- assert Protocol.isDispatchThread();
return parent;
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
index 17491ba33..dfc665cbd 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
@@ -1007,7 +1007,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
}
}
label.append(nm != null ? nm : id);
- if (ctx.hasState()) {
+ if (ctx.hasState() && !TCFModel.ID_PINNED_VIEW.equals(result.getPresentationContext().getId())) {
// Thread
if (resume_pending && resumed_by_action || model.getActiveAction(id) != null) {
image_name = ImageCache.IMG_THREAD_RUNNNIG;

Back to the top