Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-08-12 05:23:14 -0400
committerUwe Stieber2014-08-12 05:23:14 -0400
commitd52d4baa8c9fc7ac19e3b762db368bc9eeae87a1 (patch)
tree2ed279bd89ad42d70221c98ec8bf397ad8199fcf
parent03d305d35e754a3e85808ee2828bf0a2d81ff6a4 (diff)
downloadorg.eclipse.tcf-d52d4baa8c9fc7ac19e3b762db368bc9eeae87a1.tar.gz
org.eclipse.tcf-d52d4baa8c9fc7ac19e3b762db368bc9eeae87a1.tar.xz
org.eclipse.tcf-d52d4baa8c9fc7ac19e3b762db368bc9eeae87a1.zip
Target Explorer: Overwrite peer name in debug view to use connection name instead
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java
index 04d8be0ae..93852a26b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/delegates/Launch.java
@@ -21,7 +21,9 @@ import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.tcf.internal.debug.model.TCFLaunch;
import org.eclipse.tcf.protocol.IChannel;
+import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.IToken;
+import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IPathMap;
import org.eclipse.tcf.services.IPathMap.DoneSet;
import org.eclipse.tcf.services.IPathMap.PathMapRule;
@@ -86,7 +88,10 @@ public final class Launch extends TCFLaunch {
Assert.isNotNull(node);
Assert.isNotNull(callback);
- final String name = node.getPeer().getName();
+ // Remember the peer node
+ properties.setProperty("node", node); //$NON-NLS-1$
+ // Determine the peer name to pass on to the TCF launch
+ final String name = node.getName();
// The debugger is using it's own channel as the implementation
// calls for channel.terminate(...) directly
@@ -128,6 +133,19 @@ public final class Launch extends TCFLaunch {
}
/* (non-Javadoc)
+ * @see org.eclipse.tcf.internal.debug.model.TCFLaunch#getPeerName(org.eclipse.tcf.protocol.IPeer)
+ */
+ @Override
+ protected String getPeerName(IPeer peer) {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(peer);
+
+ IPeerNode node = (IPeerNode)properties.getProperty("node"); //$NON-NLS-1$
+
+ return node != null ? node.getName() : super.getPeerName(peer);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.tcf.internal.debug.model.TCFLaunch#readCustomPathMapConfiguration(org.eclipse.tcf.protocol.IChannel, org.eclipse.debug.core.ILaunchConfiguration, java.util.List)
*/
@Override
@@ -136,9 +154,12 @@ public final class Launch extends TCFLaunch {
Assert.isNotNull(cfg);
Assert.isNotNull(host_path_map);
- IPathMapGeneratorService generator = ServiceManager.getInstance().getService(channel.getRemotePeer(), IPathMapGeneratorService.class);
+ IPeerNode node = (IPeerNode)properties.getProperty("node"); //$NON-NLS-1$
+ IPeer peer = node != null ? node.getPeer() : channel.getRemotePeer();
+
+ IPathMapGeneratorService generator = ServiceManager.getInstance().getService(peer, IPathMapGeneratorService.class);
if (generator != null) {
- PathMapRule[] generatedRules = generator.getPathMap(channel.getRemotePeer());
+ PathMapRule[] generatedRules = generator.getPathMap(peer);
if (generatedRules != null && generatedRules.length > 0) {
host_path_map.addAll(Arrays.asList(generatedRules));
}

Back to the top