From d972a75391c527ba217e02663eeecc9f47f92549 Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Tue, 27 Aug 2013 17:38:05 +0200 Subject: Target Explorer: Further improve path map handling on open channel --- .../core/internal/services/PathMapService.java | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch') diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java index 435452816..8a2fcc88a 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java @@ -15,7 +15,7 @@ import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Platform; import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate; +import org.eclipse.tcf.services.IPathMap; import org.eclipse.tcf.services.IPathMap.PathMapRule; import org.eclipse.tcf.te.runtime.services.AbstractService; import org.eclipse.tcf.te.tcf.core.interfaces.IPathMapService; @@ -28,7 +28,7 @@ public class PathMapService extends AbstractService implements IPathMapService { /* (non-Javadoc) * @see org.eclipse.tcf.te.tcf.core.interfaces.IPathMapService#getPathMap(java.lang.Object) */ - @Override + @Override public PathMapRule[] getPathMap(Object context) { Assert.isNotNull(context); @@ -42,9 +42,14 @@ public class PathMapService extends AbstractService implements IPathMapService { if (config != null) { try { - String path_map_cfg = config.getAttribute(TCFLaunchDelegate.ATTR_PATH_MAP, ""); //$NON-NLS-1$ - ArrayList map = TCFLaunchDelegate.parsePathMapAttribute(path_map_cfg); - if (map != null && !map.isEmpty()) { + String path_map_cfg = config.getAttribute(org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate.ATTR_PATH_MAP, ""); //$NON-NLS-1$ + ArrayList map = org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate.parsePathMapAttribute(path_map_cfg); + path_map_cfg = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, ""); //$NON-NLS-1$ + map.addAll(org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate.parseSourceLocatorMemento(path_map_cfg)); + if (!map.isEmpty()) { + int cnt = 0; + String id = getClientID(); + for (PathMapRule r : map) r.getProperties().put(IPathMap.PROP_ID, id + "/" + cnt++); //$NON-NLS-1$ rules = map.toArray(new PathMapRule[map.size()]); } } catch (CoreException e) { /* ignored on purpose */ } @@ -53,4 +58,12 @@ public class PathMapService extends AbstractService implements IPathMapService { return rules; } + /* (non-Javadoc) + * @see org.eclipse.tcf.te.tcf.core.interfaces.IPathMapService#getClientID() + */ + @SuppressWarnings("restriction") + @Override + public String getClientID() { + return org.eclipse.tcf.internal.debug.Activator.getClientID(); + } } -- cgit v1.2.3