author | ryall |
Fri, 17 Sep 2010 09:37:31 -0600 | |
changeset 2039 | 250d6109c006 |
parent 1102 | fc2867001a80 |
child 2057 | 0e5047589ea2 |
permissions | -rw-r--r-- |
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
1 |
/* |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
3 |
* All rights reserved. |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
8 |
* |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
9 |
* Initial Contributors: |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
11 |
* |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
12 |
* Contributors: |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
13 |
* |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
14 |
* Description: |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
15 |
* |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
16 |
*/ |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
17 |
package com.nokia.cdt.debug.common.internal.executables; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
18 |
|
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
19 |
import java.util.ArrayList; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
20 |
import java.util.Arrays; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
21 |
import java.util.Iterator; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
22 |
|
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
23 |
import org.eclipse.cdt.debug.core.CDebugCorePlugin; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
24 |
import org.eclipse.cdt.debug.core.executables.ISourceFileRemapping; |
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
25 |
import org.eclipse.cdt.debug.core.sourcelookup.MappingSourceContainer; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
26 |
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
27 |
import org.eclipse.cdt.debug.internal.core.sourcelookup.MapEntrySourceContainer; |
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
28 |
import org.eclipse.core.resources.IFile; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
29 |
import org.eclipse.core.resources.IResource; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
30 |
import org.eclipse.core.runtime.CoreException; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
31 |
import org.eclipse.core.runtime.IPath; |
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
32 |
import org.eclipse.core.runtime.IProgressMonitor; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
33 |
import org.eclipse.core.runtime.IStatus; |
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
34 |
import org.eclipse.core.runtime.Path; |
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
35 |
import org.eclipse.core.runtime.Status; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
36 |
import org.eclipse.core.runtime.jobs.Job; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
37 |
import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
38 |
import org.eclipse.debug.core.sourcelookup.ISourceContainer; |
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
39 |
import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
40 |
|
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
41 |
import com.nokia.cdt.debug.common.internal.source.lookup.SymbianSourceContainer; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
42 |
|
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
43 |
public class SymbianSourceFileRemapping implements ISourceFileRemapping { |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
44 |
|
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
45 |
public final String foundMappingsContainerName = "Found Mappings"; //$NON-NLS-1$ |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
46 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
47 |
private Job saveThePrefsJob = new Job(""){ |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
48 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
49 |
@Override |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
50 |
protected IStatus run(IProgressMonitor monitor) { |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
51 |
System.out.println("save prefs"); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
52 |
CDebugCorePlugin.getDefault().savePluginPreferences(); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
53 |
return Status.OK_STATUS; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
54 |
}}; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
55 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
56 |
@SuppressWarnings("restriction") |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
57 |
private void addSourceMappingToDirector(IPath missingPath, IPath newSourcePath, AbstractSourceLookupDirector director) throws CoreException { |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
58 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
59 |
ArrayList<ISourceContainer> containerList = new ArrayList<ISourceContainer>(Arrays.asList(director.getSourceContainers())); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
60 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
61 |
boolean hasFoundMappings = false; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
62 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
63 |
MappingSourceContainer foundMappings = null; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
64 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
65 |
for (Iterator<ISourceContainer> iter = containerList.iterator(); iter.hasNext() && !hasFoundMappings;) { |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
66 |
ISourceContainer container = (ISourceContainer) iter.next(); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
67 |
if (container instanceof MappingSourceContainer) |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
68 |
{ |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
69 |
hasFoundMappings = container.getName().equals(foundMappingsContainerName); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
70 |
if (hasFoundMappings) |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
71 |
foundMappings = (MappingSourceContainer) container; |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
72 |
} |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
73 |
} |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
74 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
75 |
if (!hasFoundMappings) { |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
76 |
foundMappings = new MappingSourceContainer(foundMappingsContainerName); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
77 |
foundMappings.init(director); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
78 |
containerList.add(foundMappings); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
79 |
director.setSourceContainers((ISourceContainer[]) containerList.toArray(new ISourceContainer[containerList.size()])); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
80 |
} |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
81 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
82 |
foundMappings.addMapEntry(new MapEntrySourceContainer(missingPath, newSourcePath)); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
83 |
} |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
84 |
|
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
85 |
@SuppressWarnings("restriction") |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
86 |
private void addSourceMappingToCommon(IPath missingPath, IPath newSourcePath) throws CoreException { |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
87 |
CSourceLookupDirector director = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector(); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
88 |
addSourceMappingToDirector(missingPath, newSourcePath, director); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
89 |
// We need to save the prefs to make sure this is persistent. But if we do it immediately |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
90 |
// here it will be slow and redundant if we are being used to remap a large collection |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
91 |
// of source files. So we save the prefs later in a job. |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
92 |
saveThePrefsJob.cancel(); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
93 |
saveThePrefsJob.schedule(1000); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
94 |
} |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
95 |
|
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
96 |
public String remapSourceFile(IPath executable, String filePath) { |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
97 |
|
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
98 |
try { |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
99 |
// handle the case where the common lookup finds the file in the workspace |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
100 |
Object[] foundElements = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector().findSourceElements(filePath); |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
101 |
if (foundElements.length == 1 && foundElements[0] instanceof IFile) { |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
102 |
IFile newLocation = (IFile) foundElements[0]; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
103 |
return newLocation.getLocation().toOSString(); |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
104 |
} |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
105 |
} catch (CoreException e1) { |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
106 |
} |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
107 |
|
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
108 |
String epocRoot = ""; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
109 |
String[] segs = executable.segments(); |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
110 |
for (int i = 0; i < segs.length; i++) { |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
111 |
if (segs[i].equalsIgnoreCase("epoc32")) |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
112 |
epocRoot = executable.removeLastSegments(segs.length - i).toOSString(); |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
113 |
} |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
114 |
if (epocRoot.length() > 0) |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
115 |
{ |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
116 |
SymbianSourceContainer symbianSourceContainer = new SymbianSourceContainer(new Path(epocRoot)); |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
117 |
try { |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
118 |
Object[] foundElements = symbianSourceContainer.findSourceElements(filePath); |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
119 |
if (foundElements.length == 1) |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
120 |
{ |
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
121 |
IPath missingPath = new Path(filePath); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
122 |
IPath foundPath = null; |
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
123 |
if (foundElements[0] instanceof LocalFileStorage) |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
124 |
{ |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
125 |
LocalFileStorage newLocation = (LocalFileStorage) foundElements[0]; |
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
126 |
foundPath = newLocation.getFullPath(); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
127 |
filePath = foundPath.toOSString(); |
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
128 |
} |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
129 |
else |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
130 |
if (foundElements[0] instanceof IResource) |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
131 |
{ |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
132 |
IResource newResource = (IResource) foundElements[0]; |
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
133 |
foundPath = newResource.getLocation(); |
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
134 |
filePath = foundPath.toOSString(); |
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
135 |
} |
2039
250d6109c006
Add persistent source mapping for things remapped by the Symbian Source File Remapping.
ryall
parents:
1102
diff
changeset
|
136 |
addSourceMappingToCommon(missingPath, foundPath); |
1102
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
137 |
} |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
138 |
|
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
139 |
} catch (CoreException e) {} |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
140 |
} |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
141 |
|
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
142 |
return filePath; |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
143 |
} |
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
144 |
|
fc2867001a80
Refactor executables view support extension from com.nokia.carbide.cpp.edc to com.nokia.cdt.debug.common.
timkelly
parents:
diff
changeset
|
145 |
} |