fixed bug #10282.
authorwpaul
Wed, 16 Dec 2009 14:58:27 -0600
changeset 690 139a9d8351fe
parent 688 ae5ff180a61d
child 695 56780cf045d5
fixed bug #10282.
debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java
--- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java	Wed Dec 16 10:28:34 2009 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java	Wed Dec 16 14:58:27 2009 -0600
@@ -16,9 +16,11 @@
 */
 package com.nokia.cdt.debug.cw.symbian.ui.executables;
 
+import org.eclipse.cdt.debug.core.CDebugCorePlugin;
 import org.eclipse.cdt.debug.core.executables.ISourceFileRemapping;
 import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
 import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector;
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
@@ -35,6 +37,16 @@
 
 	public String remapSourceFile(IPath executable, String filePath) {
 
+		try {
+			// handle the case where the common lookup finds the file in the workspace
+			Object[] foundElements = CDebugCorePlugin.getDefault().getCommonSourceLookupDirector().findSourceElements(filePath);
+			if (foundElements.length == 1 && foundElements[0] instanceof IFile) {
+				IFile newLocation = (IFile) foundElements[0];
+				return newLocation.getLocation().toOSString();
+			}
+		} catch (CoreException e1) {
+		}
+		
 		String epocRoot = "";
 		String[] segs = executable.segments();
 		for (int i = 0; i < segs.length; i++) {