update to work with Helios and CDT 7.0.
authorwpaul
Thu, 18 Feb 2010 15:34:09 -0600
changeset 994 1ffe668575e7
parent 993 df87e2d581e4
child 996 1923bf044315
update to work with Helios and CDT 7.0.
debuggercdi/com.nokia.cdt.debug.cw.symbian/plugin.xml
debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/CarbideExecutablesProvider.java
debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java
debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemappingFactory.java
debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AbstractSymbianLaunchShortcut.java
--- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/plugin.xml	Thu Feb 18 15:25:23 2010 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/plugin.xml	Thu Feb 18 15:34:09 2010 -0600
@@ -199,7 +199,7 @@
 
    <extension
        point="org.eclipse.cdt.debug.core.SourceRemappingProvider">
-      <provider class="com.nokia.cdt.debug.cw.symbian.ui.executables.SymbianSourceFileRemapping"/>
+      <provider class="com.nokia.cdt.debug.cw.symbian.ui.executables.SymbianSourceFileRemappingFactory"/>
    </extension>
    
    <!-- *************** Preference Page Keyword Filtering **************** -->
--- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/CarbideExecutablesProvider.java	Thu Feb 18 15:25:23 2010 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/CarbideExecutablesProvider.java	Thu Feb 18 15:34:09 2010 -0600
@@ -25,6 +25,7 @@
 import org.eclipse.cdt.core.CProjectNature;
 import org.eclipse.cdt.debug.core.executables.Executable;
 import org.eclipse.cdt.debug.core.executables.IProjectExecutablesProvider;
+import org.eclipse.cdt.debug.core.executables.ISourceFileRemapping;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -37,6 +38,7 @@
 import com.nokia.carbide.cdt.builder.EpocEngineHelper;
 import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
 import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
+import com.nokia.cdt.debug.cw.symbian.ui.executables.SymbianSourceFileRemapping;
 
 public class CarbideExecutablesProvider implements IProjectExecutablesProvider {
 
@@ -77,7 +79,8 @@
 							File hpFile = hp.toFile();
 							if (hpFile.exists()) {
 								try {
-									Executable exe = new Executable(new Path(hpFile.getCanonicalPath()), project, null);
+									Executable exe = new Executable(new Path(hpFile.getCanonicalPath()),
+											project, null, new ISourceFileRemapping[] {new SymbianSourceFileRemapping()});
 									executables.add(exe);
 								} catch (Exception e) {
 								}
--- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java	Thu Feb 18 15:25:23 2010 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemapping.java	Thu Feb 18 15:34:09 2010 -0600
@@ -18,17 +18,11 @@
 
 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;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.ISourceLocator;
 import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
 
 import com.nokia.cdt.debug.cw.symbian.SymbianSourceContainer;
@@ -58,25 +52,6 @@
 			SymbianSourceContainer symbianSourceContainer = new SymbianSourceContainer(new Path(epocRoot));
 			try {
 				Object[] foundElements = symbianSourceContainer.findSourceElements(filePath);
-				
-				if (foundElements.length == 0)
-				{
-					Object foundElement = null;
-					ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager();
-					ILaunch[] launches = launchMgr.getLaunches();
-					for (ILaunch launch : launches) {
-						ISourceLocator locator = launch.getSourceLocator();
-						if ( locator instanceof ICSourceLocator || locator instanceof CSourceLookupDirector ) {
-							if ( locator instanceof ICSourceLocator )
-								foundElement = ((ICSourceLocator)locator).findSourceElement( filePath );
-							else
-								foundElement = ((CSourceLookupDirector)locator).getSourceElement( filePath );
-						}
-					}
-					if (foundElement != null)
-						foundElements = new Object[] {foundElement};				
-				}
-				
 				if (foundElements.length == 1)
 				{
 					if (foundElements[0] instanceof LocalFileStorage)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/SymbianSourceFileRemappingFactory.java	Thu Feb 18 15:34:09 2010 -0600
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+package com.nokia.cdt.debug.cw.symbian.ui.executables;
+
+import org.eclipse.cdt.core.model.IBinary;
+import org.eclipse.cdt.debug.core.executables.ISourceFileRemapping;
+import org.eclipse.cdt.debug.core.executables.ISourceFileRemappingFactory;
+
+public class SymbianSourceFileRemappingFactory implements ISourceFileRemappingFactory {
+
+	public ISourceFileRemapping createRemapper(IBinary binary) {
+		return new SymbianSourceFileRemapping();
+	}
+
+}
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AbstractSymbianLaunchShortcut.java	Thu Feb 18 15:25:23 2010 -0600
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AbstractSymbianLaunchShortcut.java	Thu Feb 18 15:34:09 2010 -0600
@@ -3,6 +3,7 @@
 import java.util.List;
 
 import org.eclipse.cdt.debug.core.executables.Executable;
+import org.eclipse.cdt.debug.core.executables.ISourceFileRemapping;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
@@ -19,6 +20,7 @@
 import org.eclipse.ui.IFileEditorInput;
 
 import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
+import com.nokia.cdt.debug.cw.symbian.ui.executables.SymbianSourceFileRemapping;
 
 public abstract class AbstractSymbianLaunchShortcut implements ILaunchShortcut2 {
 
@@ -92,7 +94,8 @@
 					}
 					else
 					{		
-						executable = new Executable(file.getLocation(), file.getProject(), file);
+						executable = new Executable(file.getLocation(), file.getProject(), file,
+								new ISourceFileRemapping[] {new SymbianSourceFileRemapping()});
 						launchProject(file.getProject(), executable, defaultMMP, mode);
 						launched = true;					
 					}
@@ -128,7 +131,8 @@
 					{
 						defaultMMP = filePath;
 					}
-					Executable executable = new Executable(file.getLocation(), file.getProject(), file);
+					Executable executable = new Executable(file.getLocation(), file.getProject(), file,
+							new ISourceFileRemapping[] {new SymbianSourceFileRemapping()});
 					return LaunchPlugin.getDefault().getLaunchConfigurations(file.getProject(), executable, defaultMMP);
 				}
 			}