Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruwe2013-09-03 11:18:31 -0400
committeruwe2013-09-03 11:18:31 -0400
commit3c87d0ef2d620b88d7e4a9386c7dca26e23b967d (patch)
tree627fa82edbb4b1b8fc16ccb05333a4ccd24eb883 /target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core
parent91db3174c21b7435c234dc8baf35f62cbd8caa82 (diff)
downloadorg.eclipse.tcf-3c87d0ef2d620b88d7e4a9386c7dca26e23b967d.tar.gz
org.eclipse.tcf-3c87d0ef2d620b88d7e4a9386c7dca26e23b967d.tar.xz
org.eclipse.tcf-3c87d0ef2d620b88d7e4a9386c7dca26e23b967d.zip
Target Explorer: Extend path map service to include auto-generated path maps
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java34
1 files changed, 25 insertions, 9 deletions
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 1d19733a2..df407872e 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013 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
@@ -10,6 +10,8 @@
package org.eclipse.tcf.te.tcf.launch.core.internal.services;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
@@ -19,6 +21,8 @@ import org.eclipse.tcf.protocol.Protocol;
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.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.tcf.core.interfaces.IPathMapGeneratorService;
import org.eclipse.tcf.te.tcf.core.interfaces.IPathMapService;
/**
@@ -35,6 +39,7 @@ public class PathMapService extends AbstractService implements IPathMapService {
Assert.isNotNull(context);
PathMapRule[] rules = null;
+ List<PathMapRule> rulesList = new ArrayList<PathMapRule>();
// Get the launch configuration for that peer model
ILaunchConfiguration config = (ILaunchConfiguration) Platform.getAdapterManager().getAdapter(context, ILaunchConfiguration.class);
@@ -44,19 +49,30 @@ public class PathMapService extends AbstractService implements IPathMapService {
if (config != null) {
try {
+
String path_map_cfg = config.getAttribute(org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate.ATTR_PATH_MAP, ""); //$NON-NLS-1$
- ArrayList<org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate.PathMapRule> map = org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate.parsePathMapAttribute(path_map_cfg);
+ rulesList.addAll(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()]);
- }
+ rulesList.addAll(org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate.parseSourceLocatorMemento(path_map_cfg));
} catch (CoreException e) { /* ignored on purpose */ }
}
+ IPathMapGeneratorService generator = ServiceManager.getInstance().getService(context, IPathMapGeneratorService.class);
+ if (generator != null) {
+ PathMapRule[] generatedRules = generator.getPathMap(context);
+ if (generatedRules != null && generatedRules.length > 0) {
+ rulesList.addAll(Arrays.asList(generatedRules));
+ }
+ }
+
+ if (!rulesList.isEmpty()) {
+ int cnt = 0;
+ String id = getClientID();
+ for (PathMapRule r : rulesList) r.getProperties().put(IPathMap.PROP_ID, id + "/" + cnt++); //$NON-NLS-1$
+ rules = rulesList.toArray(new PathMapRule[rulesList.size()]);
+ }
+
return rules;
}

Back to the top