Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-10-15 08:09:30 -0400
committerUwe Stieber2013-10-15 08:09:30 -0400
commit9ff5c91040ced5bbf286b21dd1b6584c95c2c006 (patch)
treebd67cc7e483c0029bc9e70eccde37b23798dac5a /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf
parentb39cf151a6c21acaa4ccd9fc0968d3a3b5ef48fc (diff)
downloadorg.eclipse.tcf-9ff5c91040ced5bbf286b21dd1b6584c95c2c006.tar.gz
org.eclipse.tcf-9ff5c91040ced5bbf286b21dd1b6584c95c2c006.tar.xz
org.eclipse.tcf-9ff5c91040ced5bbf286b21dd1b6584c95c2c006.zip
Target Explorer: Fix handling of auto attach to all contexts on connect and once the debug button is pressed in the connection properties editor
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
index 3be1f4fd7..ae58ac288 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
@@ -16,7 +16,9 @@ import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -27,7 +29,9 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.steps.StartDebuggerStep.IDelegate;
import org.eclipse.tcf.te.ui.async.UICallbackInvocationDelegate;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchPart;
@@ -98,9 +102,22 @@ public class StartDebugCommandHandler extends AbstractHandler {
IDebugService dbgService = ServiceManager.getInstance().getService(peerModel, IDebugService.class, false);
if (dbgService != null) {
- // Attach the debugger and all cores (OCDDevices)
+ final IProgressMonitor monitor = new NullProgressMonitor();
IPropertiesContainer props = new PropertiesContainer();
- dbgService.attach(peerModel, props, null, callback);
+ dbgService.attach(peerModel, props, monitor, new Callback() {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ // Check if there is a delegate registered
+ IUIService uiService = ServiceManager.getInstance().getService(peerModel, IUIService.class, false);
+ IDelegate delegate = uiService != null ? uiService.getDelegate(peerModel, IDelegate.class) : null;
+
+ if (delegate != null) {
+ delegate.postAttachDebugger(peerModel, monitor, callback);
+ } else {
+ callback.done(caller, status);
+ }
+ }
+ });
}
}
}

Back to the top