# HG changeset patch # User timkelly # Date 1268340613 21600 # Node ID 88ab187cbeb81f3999f755eec6f747469d335102 # Parent ccb2c2352e06ac1347af99bf48274ba4fef98fcc Refactor source mapping to com.nokia.cdt.debug.common plugin diff -r ccb2c2352e06 -r 88ab187cbeb8 debuggercdi/com.nokia.cdt.debug.cw.symbian/plugin.xml --- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/plugin.xml Thu Mar 11 14:18:02 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/plugin.xml Thu Mar 11 14:50:13 2010 -0600 @@ -31,13 +31,6 @@ - - - - @@ -137,17 +130,7 @@ - - - - - - + + + + diff -r ccb2c2352e06 -r 88ab187cbeb8 debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java --- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java Thu Mar 11 14:18:02 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java Thu Mar 11 14:50:13 2010 -0600 @@ -176,7 +176,7 @@ static private void addSymbianSDKMapping(String epocRoot, ILaunchConfigurationWorkingCopy configuration) { if (epocRoot.length() > 0 && new File(epocRoot).exists()) configuration.setAttribute(SymbianPlugin.Epoc_Root, epocRoot); -} + } static public void addSymbianSDKMapping(Path executable, ILaunchConfigurationWorkingCopy configuration) { diff -r ccb2c2352e06 -r 88ab187cbeb8 debuggercdi/com.nokia.cdt.debug.launch/META-INF/MANIFEST.MF --- a/debuggercdi/com.nokia.cdt.debug.launch/META-INF/MANIFEST.MF Thu Mar 11 14:18:02 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/META-INF/MANIFEST.MF Thu Mar 11 14:50:13 2010 -0600 @@ -6,7 +6,8 @@ Bundle-Activator: com.nokia.cdt.internal.debug.launch.LaunchPlugin Bundle-Vendor: Nokia Bundle-Localization: plugin -Require-Bundle: org.eclipse.ui, +Require-Bundle: com.nokia.cdt.debug.common, + org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.cdt.launch, org.eclipse.cdt.debug.core, @@ -28,10 +29,12 @@ com.nokia.cpp.utils.core, com.freescale.cdt.debug.cw.core.ui, com.nokia.carbide.remoteConnections, - com.nokia.cpp.utils.ui + com.nokia.cpp.utils.ui, + com.nokia.carbide.cpp.edc;bundle-version="1.0.0" Bundle-ActivationPolicy: lazy Export-Package: com.nokia.cdt.internal.debug.launch, com.nokia.cdt.internal.debug.launch.ui, com.nokia.cdt.internal.debug.launch.wizard Bundle-ClassPath: lib/JSiMa.jar, . + diff -r ccb2c2352e06 -r 88ab187cbeb8 debuggercdi/com.nokia.cdt.debug.launch/plugin.xml --- a/debuggercdi/com.nokia.cdt.debug.launch/plugin.xml Thu Mar 11 14:18:02 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/plugin.xml Thu Mar 11 14:50:13 2010 -0600 @@ -7,7 +7,7 @@ + sourcePathComputerId="com.nokia.cdt.debug.common.internal.source.lookup.CarbideSourcePathComputer"> + sourcePathComputerId="com.nokia.cdt.debug.common.internal.source.lookup.CarbideSourcePathComputer"> + sourcePathComputerId="com.nokia.cdt.debug.common.internal.source.lookup.CarbideSourcePathComputer"> + sourcePathComputerId="com.nokia.cdt.debug.common.internal.source.lookup.CarbideSourcePathComputer"> diff -r ccb2c2352e06 -r 88ab187cbeb8 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AbstractSymbianLaunchShortcut.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AbstractSymbianLaunchShortcut.java Thu Mar 11 14:18:02 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AbstractSymbianLaunchShortcut.java Thu Mar 11 14:50:13 2010 -0600 @@ -20,7 +20,7 @@ import org.eclipse.ui.IFileEditorInput; import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; -import com.nokia.cdt.debug.cw.symbian.ui.executables.SymbianSourceFileRemapping; +import com.nokia.carbide.cpp.edc.executables.SymbianSourceFileRemapping; public abstract class AbstractSymbianLaunchShortcut implements ILaunchShortcut2 { diff -r ccb2c2352e06 -r 88ab187cbeb8 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/NokiaAbstractLaunchDelegate.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/NokiaAbstractLaunchDelegate.java Thu Mar 11 14:18:02 2010 -0600 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/NokiaAbstractLaunchDelegate.java Thu Mar 11 14:50:13 2010 -0600 @@ -19,10 +19,8 @@ import java.text.DateFormat; import java.text.MessageFormat; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.Date; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.StringTokenizer; @@ -41,22 +39,16 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.jobs.IJobManager; import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.model.ISourceLocator; -import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Display; import com.freescale.cdt.debug.cw.core.cdi.Session; import com.nokia.carbide.cdt.builder.builder.CarbideCPPBuilder; -import com.nokia.cdt.debug.cw.symbian.SymbianPlugin; -import com.nokia.cdt.debug.cw.symbian.SymbianSourceContainer; +import com.nokia.carbide.cpp.debug.kernelaware.OSDataManager; +import com.nokia.cdt.debug.common.internal.source.lookup.SourceMappingUtils; import com.nokia.cdt.debug.cw.symbian.ui.executables.ExecutableTargeted; -import com.nokia.carbide.cpp.debug.kernelaware.OSDataManager; import com.nokia.cdt.internal.debug.launch.ui.ExecutablesTab; public abstract class NokiaAbstractLaunchDelegate extends @@ -204,7 +196,7 @@ ICProject project, ILaunchConfiguration config) throws CoreException { ILaunchConfigurationWorkingCopy workingCopy = config.getWorkingCopy(); - addSourceMappingToLaunch(workingCopy); + SourceMappingUtils.addSourceMappingToLaunch(workingCopy); return workingCopy.doSave(); } @@ -343,62 +335,7 @@ } - private void addSourceMappingToDirector(AbstractSourceLookupDirector director, ILaunchConfiguration configuration) throws CoreException { - ArrayList containerList = new ArrayList(Arrays.asList(director.getSourceContainers())); - - boolean hasSymbianContainer = false; - - SymbianSourceContainer symbianContainer = null; - - for (Iterator iter = containerList.iterator(); iter.hasNext() && !hasSymbianContainer;) { - ISourceContainer container = (ISourceContainer) iter.next(); - if (container instanceof SymbianSourceContainer) - { - hasSymbianContainer = true; - } - } - - if (!hasSymbianContainer) { - - String epocRootPath = configuration.getAttribute( SymbianPlugin.Epoc_Root, (String)null ); - if (epocRootPath != null) - { - symbianContainer = new SymbianSourceContainer(new Path(epocRootPath)); - symbianContainer.init(director); - containerList.add(symbianContainer); - } - } - - director.setSourceContainers((ISourceContainer[]) containerList.toArray(new ISourceContainer[containerList.size()])); - } - - private void addSourceMappingToLaunch(ILaunchConfigurationWorkingCopy configuration) throws CoreException { - String memento = null; - String type = null; - - memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String) null); - type = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String) null); - if (type == null) { - type = configuration.getType().getSourceLocatorId(); - } - ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); - ISourceLocator locator = launchManager.newSourceLocator(type); - if (locator instanceof AbstractSourceLookupDirector) { - AbstractSourceLookupDirector director = (AbstractSourceLookupDirector) locator; - if (memento == null) { - director.initializeDefaults(configuration); - } else { - director.initializeFromMemento(memento, configuration); - } - - addSourceMappingToDirector(director, configuration); - - configuration.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, director.getMemento()); - configuration.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, director.getId()); - } - } - protected String getTargetLabel(String processName) { String format = "{0} (Launched {1})"; //$NON-NLS-1$ String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));