Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2016-03-24 09:30:04 +0000
committerUwe Stieber2016-03-24 09:30:04 +0000
commit735e52e27847e26d1816742a2ceec67ffcc048b2 (patch)
treed051339191b79178074f91ef13bdf954888aebb8 /target_explorer/plugins
parent14ac832a444a03e9f934d442da50b527978e4ab6 (diff)
downloadorg.eclipse.tcf-735e52e27847e26d1816742a2ceec67ffcc048b2.tar.gz
org.eclipse.tcf-735e52e27847e26d1816742a2ceec67ffcc048b2.tar.xz
org.eclipse.tcf-735e52e27847e26d1816742a2ceec67ffcc048b2.zip
Adapt to CDT 9.0 M6 changes
Diffstat (limited to 'target_explorer/plugins')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/services/PathMapService.java24
1 files changed, 23 insertions, 1 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 44b5f3acc..aaac932db 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
@@ -9,6 +9,7 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.core.internal.services;
+import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -24,6 +25,7 @@ import org.eclipse.cdt.debug.core.sourcelookup.MappingSourceContainer;
import org.eclipse.cdt.debug.internal.core.sourcelookup.MapEntrySourceContainer;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
@@ -91,7 +93,27 @@ public class PathMapService extends AbstractService implements IPathMapService {
MapEntrySourceContainer[] mappings = new MapEntrySourceContainer[generatedRules.length];
int i = 0;
for (PathMapRule pathMapRule : generatedRules) {
- mappings[i++] = new MapEntrySourceContainer(new Path(pathMapRule.getSource()), new Path(pathMapRule.getDestination()));
+ // CDT 9.0 changes constructor of MapEntrySourceCounter
+ MapEntrySourceContainer mapping = null;
+
+ Class<MapEntrySourceContainer> clazz = MapEntrySourceContainer.class;
+ try {
+ Constructor<MapEntrySourceContainer> c = clazz.getConstructor(IPath.class, IPath.class);
+ c.setAccessible(true);
+ mapping = c.newInstance(new Path(pathMapRule.getSource()), new Path(pathMapRule.getDestination()));
+ } catch (NoSuchMethodException e) {
+ try {
+ Constructor<MapEntrySourceContainer> c = clazz.getConstructor(String.class, IPath.class);
+ c.setAccessible(true);
+ mapping = c.newInstance(pathMapRule.getSource(), new Path(pathMapRule.getDestination()));
+ }
+ catch (Exception e2) { /* ignored on purpose */ }
+ }
+ catch (Exception e) { /* ignored on purpose */ }
+
+ if (mapping != null) {
+ mappings[i++] = mapping;
+ }
}
try {
config = addSourceMappingToLaunchConfig(config, mappings);

Back to the top