Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2011-10-05 16:56:09 -0400
committerEugene Tarassov2011-10-05 16:56:09 -0400
commitf6f9934db820418b3211af08796a24359a049626 (patch)
tree8befec2afad7880c44e0cb6bca147819154d5d7a /plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse
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/org.eclipse.tm.tcf.debug.ui/src/org/eclipse')
-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
4 files changed, 41 insertions, 18 deletions
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