Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 167248 Details for
Bug 310304
[launch][cdi] GDB (DSF) Hardware Debugging Launcher ignores application program path
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Complete fix
patch_310304 (text/plain), 85.66 KB, created by
John Cortell
on 2010-05-05 19:55:51 EDT
(
hide
)
Description:
Complete fix
Filename:
MIME Type:
Creator:
John Cortell
Created:
2010-05-05 19:55:51 EDT
Size:
85.66 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.debug.core >Index: src/org/eclipse/cdt/debug/core/CDebugUtils.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugUtils.java,v >retrieving revision 1.29 >diff -u -r1.29 CDebugUtils.java >--- src/org/eclipse/cdt/debug/core/CDebugUtils.java 13 Mar 2009 13:47:42 -0000 1.29 >+++ src/org/eclipse/cdt/debug/core/CDebugUtils.java 5 May 2010 23:49:54 -0000 >@@ -12,10 +12,10 @@ > package org.eclipse.cdt.debug.core; > > import java.io.ByteArrayOutputStream; >+import java.io.FileNotFoundException; > import java.io.IOException; > import java.nio.charset.Charset; > import java.nio.charset.CharsetDecoder; >-import com.ibm.icu.text.MessageFormat; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Iterator; >@@ -40,6 +40,7 @@ > import org.eclipse.cdt.debug.core.model.ICWatchpoint; > import org.eclipse.cdt.debug.core.model.ICWatchpoint2; > import org.eclipse.cdt.debug.internal.core.model.CFloatingPointValue; >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IMarker; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.ResourcesPlugin; >@@ -47,12 +48,15 @@ > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Path; >+import org.eclipse.core.runtime.Status; > import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.ILaunchConfiguration; > import org.eclipse.debug.core.IStatusHandler; > import org.eclipse.debug.core.model.IBreakpoint; > import org.w3c.dom.Document; > >+import com.ibm.icu.text.MessageFormat; >+ > /** > * Utility methods. > */ >@@ -561,4 +565,127 @@ > } > return new Path(path); > } >+ >+ /** >+ * Returns the ICProject associated with the project setting in the Main tab >+ * of a CDT launch configuration, or throws a CoreException providing a >+ * reason (e.g., the setting is empty, the project no longer exists, the >+ * isn't a CDT one, etc). >+ * >+ * @param config >+ * the launch configuration >+ * @return an ICProject; never null. >+ * @throws CoreException >+ * @since 7.0 >+ */ >+ public static ICProject verifyCProject(ILaunchConfiguration config) throws CoreException { >+ String name = CDebugUtils.getProjectName(config); >+ if (name == null) { >+ throwCoreException(DebugCoreMessages.getString("CDebugUtils.C_Project_not_specified"), //$NON-NLS-1$ >+ ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT); >+ } >+ ICProject cproject = CDebugUtils.getCProject(config); >+ if (cproject == null) { >+ IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(name); >+ if (!proj.exists()) { >+ throwCoreException(DebugCoreMessages.getFormattedString("CDebugUtils.Project_NAME_does_not_exist", name), //$NON-NLS-1$ >+ ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); >+ } else if (!proj.isOpen()) { >+ throwCoreException(DebugCoreMessages.getFormattedString("CDebugUtils.Project_NAME_is_closed", name), //$NON-NLS-1$ >+ ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); >+ } >+ throwCoreException(DebugCoreMessages.getString("CDebugUtils.Not_a_C_CPP_project"), //$NON-NLS-1$ >+ ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); >+ } >+ return cproject; >+ } >+ >+ /** >+ * Returns an IPath for the file referenced in the <i>C/C++ Application</i> >+ * setting of a CDT launch configuration. Typically, the file is obtained by >+ * combining the <i>C/C++ Application</i> setting with the <i>Project</i> >+ * setting. If unable to combine and resolve these settings to a valid file, >+ * a CoreException is thrown that provides the reason why. There are many >+ * such possible reasons (a problem with the <i>Project</i> setting, an >+ * empty <i>C/C++ Application</i> setting, the combined settings doesn't >+ * resolve to an existing file, etc). >+ * >+ * @param config >+ * the launch configuration >+ * @param ignoreProjectSetting >+ * if true, resolve the file using only the <i>C/C++ >+ * Application</i> setting. Do not take the <i>Project</i> >+ * setting into account. >+ * @return an IPath; never null >+ * @throws CoreException >+ * @since 7.0 >+ */ >+ public static IPath verifyProgramPath(ILaunchConfiguration config, boolean ignoreProjectSetting) throws CoreException { >+ ICProject cproject = null; >+ if (!ignoreProjectSetting) { >+ cproject = verifyCProject(config); // will throw exception if project setting not valid >+ } >+ IPath programPath = CDebugUtils.getProgramPath(config); >+ if (programPath == null || programPath.isEmpty()) { >+ throwCoreException(DebugCoreMessages.getString("CDebugUtils.Program_file_not_specified"), //$NON-NLS-1$ >+ ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM); >+ } >+ >+ if (programPath != null) { // this check is here only to avoid warning; compiler can't tell we'll throw an exception above >+ if (!programPath.isAbsolute() && (cproject != null)) { >+ // See if we can brute-force append the program path to the >+ // project location. This allows us to support the program file >+ // being outside the project, even outside the workspace, without >+ // requiring a linked resource (e.g., the setting could be >+ // "..\..\some\dir\myprogram.exe") >+ IPath location = cproject.getProject().getLocation(); >+ if (location != null) { >+ programPath = location.append(programPath); >+ if (!programPath.toFile().exists()) { >+ // Try looking in the project for the file. This >+ // supports linked resources. >+ IFile projFile = null; >+ try { >+ projFile = cproject.getProject().getFile(CDebugUtils.getProgramPath(config)); >+ } >+ catch (IllegalArgumentException exc) { >+ // thrown if relative path that resolves to a root file (e.g., "..\somefile") >+ } >+ if (projFile != null && projFile.exists()) { >+ programPath = projFile.getLocation(); >+ } >+ } >+ } >+ } >+ if (!programPath.toFile().exists()) { >+ throwCoreException( >+ DebugCoreMessages.getString("CDebugUtils.Program_file_does_not_exist"), //$NON-NLS-1$ >+ new FileNotFoundException( >+ DebugCoreMessages.getFormattedString("CDebugUtils.PROGRAM_PATH_not_found", programPath.toOSString())), //$NON-NLS-1$ >+ ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST); >+ } >+ } >+ return programPath; >+ } >+ >+ /** >+ * Variant that expects (requires) the launch configuration to have a valid >+ * <i>Project</i> setting. See >+ * {@link #verifyProgramPath(ILaunchConfiguration, boolean)} >+ * >+ * @since 7.0 >+ */ >+ public static IPath verifyProgramPath(ILaunchConfiguration config) throws CoreException { >+ return verifyProgramPath(config, false); >+ } >+ >+ /** Throws a CoreException. Clutter-reducing utility method. */ >+ private static void throwCoreException(String msg, int code) throws CoreException { >+ throwCoreException(msg, null, code); >+ } >+ >+ /** Throws a CoreException. Clutter-reducing utility method. */ >+ private static void throwCoreException(String msg, Exception innerException, int code) throws CoreException { >+ throw new CoreException(new Status(IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), code, msg, innerException)); >+ } > } >Index: src/org/eclipse/cdt/debug/core/DebugCoreMessages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/DebugCoreMessages.java,v >retrieving revision 1.5 >diff -u -r1.5 DebugCoreMessages.java >--- src/org/eclipse/cdt/debug/core/DebugCoreMessages.java 23 Jun 2006 17:52:38 -0000 1.5 >+++ src/org/eclipse/cdt/debug/core/DebugCoreMessages.java 5 May 2010 23:49:54 -0000 >@@ -13,6 +13,8 @@ > import java.util.MissingResourceException; > import java.util.ResourceBundle; > >+import com.ibm.icu.text.MessageFormat; >+ > public class DebugCoreMessages { > > private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.core.DebugCoreMessages";//$NON-NLS-1$ >@@ -22,6 +24,14 @@ > private DebugCoreMessages() { > } > >+ static String getFormattedString(String key, String arg) { >+ return MessageFormat.format(getString(key), new String[]{arg}); >+ } >+ >+ static String getFormattedString(String key, String[] args) { >+ return MessageFormat.format(getString(key), args); >+ } >+ > public static String getString( String key ) { > try { > return RESOURCE_BUNDLE.getString( key ); >Index: src/org/eclipse/cdt/debug/core/DebugCoreMessages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/DebugCoreMessages.properties,v >retrieving revision 1.12 >diff -u -r1.12 DebugCoreMessages.properties >--- src/org/eclipse/cdt/debug/core/DebugCoreMessages.properties 8 May 2008 03:16:26 -0000 1.12 >+++ src/org/eclipse/cdt/debug/core/DebugCoreMessages.properties 5 May 2010 23:49:54 -0000 >@@ -23,4 +23,12 @@ > CDebugUtils.Hardware=Hardware > CDebugUtils.Temporary=Temporary > CDebugUtils.Software=Software >+CDebugUtils.C_Project_not_specified=A project was not specified in the launch configuration. >+CDebugUtils.Not_a_C_CPP_project=The project specified in the launch configuration is not a C/C++ one. >+CDebugUtils.PROGRAM_PATH_not_found={0} not found >+CDebugUtils.Program_file_does_not_exist=The program file specified in the launch configuration does not exist >+CDebugUtils.Program_file_not_specified=A program file was not specified in the launch configuration. >+CDebugUtils.Project_NAME_does_not_exist=Project {0} does not exist. Please check that your launch configuration specifies a valid project in your workspace. >+CDebugUtils.Project_NAME_is_closed=Project {0} is closed >+ > CDIDebugModel.0=Unable to parser binary information from file >#P org.eclipse.cdt.debug.gdbjtag.core >Index: src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java,v >retrieving revision 1.6 >diff -u -r1.6 GDBJtagDSFFinalLaunchSequence.java >--- src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java 27 Apr 2010 20:17:29 -0000 1.6 >+++ src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java 5 May 2010 23:49:55 -0000 >@@ -22,6 +22,7 @@ > import java.util.List; > import java.util.Properties; > >+import org.eclipse.cdt.debug.core.CDebugUtils; > import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContribution; > import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContributionFactory; > import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice; >@@ -345,7 +346,7 @@ > // Below steps are specific to JTag hardware debugging > > /* >- * Retrieve the JTag device >+ * Retrieve the IGDBJtagDevice instance > */ > new Step() { > @Override >@@ -365,6 +366,61 @@ > rm.done(); > }}, > /* >+ * Execute symbol loading >+ */ >+ new Step() { >+ @Override >+ public void execute(RequestMonitor rm) { >+ ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); >+ try { >+ if (config.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)) { >+ String symbolsFileName = null; >+ >+ // New setting in Helios. Default is true. Check for existence >+ // in order to support older launch configs >+ if (config.hasAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS) && >+ config.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS)) { >+ IPath programFile = CDebugUtils.verifyProgramPath(config); >+ if (programFile != null) { >+ symbolsFileName = programFile.toOSString(); >+ } >+ } >+ else { >+ symbolsFileName = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME); >+ if (symbolsFileName.length() > 0) { >+ symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName); >+ } else { >+ symbolsFileName = null; >+ } >+ } >+ >+ if (symbolsFileName == null) { >+ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, Messages.getString("GDBJtagDebugger.err_no_img_file"), null)); //$NON-NLS-1$ >+ rm.done(); >+ return; >+ } >+ >+ // Escape windows path separator characters TWICE, once for Java and once for GDB. >+ symbolsFileName = symbolsFileName.replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ String symbolsOffset = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET); >+ if (symbolsOffset.length() > 0) { >+ symbolsOffset = "0x" + symbolsOffset; >+ } >+ List<String> commands = new ArrayList<String>(); >+ fGdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands); >+ queueCommands(commands, rm); >+ >+ } else { >+ rm.done(); >+ } >+ } catch (CoreException e) { >+ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot load symbol", e)); //$NON-NLS-1$ >+ rm.done(); >+ } >+ }}, >+ >+ /* > * Hook up to remote target > */ > new Step() { >@@ -394,7 +450,7 @@ > public void execute(RequestMonitor rm) { > ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); > try { >- if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, true)) { >+ if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)) { > List<String> commands = new ArrayList<String>(); > fGdbJtagDevice.doReset(commands); > queueCommands(commands, rm); >@@ -431,7 +487,7 @@ > public void execute(RequestMonitor rm) { > ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); > try { >- if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, true)) { >+ if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)) { > List<String> commands = new ArrayList<String>(); > fGdbJtagDevice.doHalt(commands); > queueCommands(commands, rm); >@@ -451,16 +507,21 @@ > public void execute(RequestMonitor rm) { > ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); > try { >- String userCmd = config.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, ""); //$NON-NLS-1$ >+ String userCmd = config.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS); > userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd); >- String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$ >- >- CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); >- crm.setDoneCount(commands.length); >- for (int i = 0; i < commands.length; ++i) { >- fCommandControl.queueCommand( >- new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]), >- new DataRequestMonitor<MIInfo>(getExecutor(), crm)); >+ if (userCmd.length() > 0) { >+ String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$ >+ >+ CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); >+ crm.setDoneCount(commands.length); >+ for (int i = 0; i < commands.length; ++i) { >+ fCommandControl.queueCommand( >+ new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]), >+ new DataRequestMonitor<MIInfo>(getExecutor(), crm)); >+ } >+ } >+ else { >+ rm.done(); > } > } catch (CoreException e) { > rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot run user defined init commands", e)); //$NON-NLS-1$ >@@ -475,20 +536,44 @@ > public void execute(RequestMonitor rm) { > ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); > try { >+ String imageFileName = null; > if (config.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE)) { >- // Escape windows path separator characters TWICE, once for Java and once for GDB. >- String imageFileName = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$ >- if (imageFileName.length() > 0) { >- imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName).replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$ >- String imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ >- List<String> commands = new ArrayList<String>(); >- fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands); >- queueCommands(commands, rm); >- } else { >- rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Image name cannot be empty", null)); //$NON-NLS-1$ >- rm.done(); >+ // New setting in Helios. Default is true. Check for existence >+ // in order to support older launch configs >+ if (config.hasAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE) && >+ config.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE)) { >+ IPath programFile = CDebugUtils.verifyProgramPath(config); >+ if (programFile != null) { >+ imageFileName = programFile.toOSString(); >+ } > } >- } else { >+ else { >+ imageFileName = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME); //$NON-NLS-1$ >+ if (imageFileName.length() > 0) { >+ imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName); >+ } else { >+ imageFileName = null; >+ } >+ } >+ >+ if (imageFileName == null) { >+ rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, Messages.getString("GDBJtagDebugger.err_no_img_file"), null)); //$NON-NLS-1$ >+ rm.done(); >+ return; >+ } >+ >+ // Escape windows path separator characters TWICE, once for Java and once for GDB. >+ imageFileName = imageFileName.replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ String imageOffset = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); >+ if (imageOffset.length() > 0) { >+ imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); //$NON-NLS-2$ //$NON-NLS-4$ >+ } >+ List<String> commands = new ArrayList<String>(); >+ fGdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands); >+ queueCommands(commands, rm); >+ } >+ else { > rm.done(); > } > } catch (CoreException e) { >@@ -496,36 +581,6 @@ > rm.done(); > } > }}, >- /* >- * Execute symbol loading >- */ >- new Step() { >- @Override >- public void execute(RequestMonitor rm) { >- ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); >- try { >- if (config.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)) { >- // Escape windows path separator characters TWICE, once for Java and once for GDB. >- String symbolsFileName = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, ""); //$NON-NLS-1$ >- if (symbolsFileName.length() > 0) { >- symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName).replace("\\", "\\\\"); //$NON-NLS-1$ //$NON-NLS-2$ >- String symbolsOffset = "0x" + config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, ""); //$NON-NLS-1$ //$NON-NLS-2$ >- List<String> commands = new ArrayList<String>(); >- fGdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands); >- queueCommands(commands, rm); >- } else { >- rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Symbol name cannot be empty", null)); //$NON-NLS-1$ >- rm.done(); >- } >- } else { >- rm.done(); >- } >- } catch (CoreException e) { >- rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot load symbol", e)); //$NON-NLS-1$ >- rm.done(); >- } >- } >- }, > /* > * Start tracking the breakpoints once we know we are connected to the target (necessary for remote debugging) > */ >@@ -550,7 +605,7 @@ > ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); > try { > if (config.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)) { >- String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$ >+ String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_PC_REGISTER)); //$NON-NLS-1$ > List<String> commands = new ArrayList<String>(); > fGdbJtagDevice.doSetPC(pcRegister, commands); > queueCommands(commands, rm); >@@ -571,7 +626,7 @@ > ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); > try { > if (config.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)) { >- String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, ""); //$NON-NLS-1$ >+ String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT); //$NON-NLS-1$ > List<String> commands = new ArrayList<String>(); > fGdbJtagDevice.doStopAt(stopAt, commands); > queueCommands(commands, rm); >@@ -612,16 +667,21 @@ > public void execute(RequestMonitor rm) { > ILaunchConfiguration config = fLaunch.getLaunchConfiguration(); > try { >- String userCmd = config.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, ""); //$NON-NLS-1$ >- userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd); >- String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$ >- >- CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); >- crm.setDoneCount(commands.length); >- for (int i = 0; i < commands.length; ++i) { >- fCommandControl.queueCommand( >- new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]), >- new DataRequestMonitor<MIInfo>(getExecutor(), crm)); >+ String userCmd = config.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS); //$NON-NLS-1$ >+ if (userCmd.length() > 0) { >+ userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd); >+ String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$ >+ >+ CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); >+ crm.setDoneCount(commands.length); >+ for (int i = 0; i < commands.length; ++i) { >+ fCommandControl.queueCommand( >+ new CLICommand<MIInfo>(fCommandControl.getContext(), commands[i]), >+ new DataRequestMonitor<MIInfo>(getExecutor(), crm)); >+ } >+ } >+ else { >+ rm.done(); > } > } catch (CoreException e) { > rm.setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, -1, "Cannot run user defined run commands", e)); //$NON-NLS-1$ >@@ -687,12 +747,11 @@ > private IGDBJtagDevice getGDBJtagDevice (ILaunchConfiguration config) > throws CoreException, NullPointerException { > IGDBJtagDevice gdbJtagDevice = null; >- String jtagDeviceName = config.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$ >- GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory. >- getInstance().getGDBJtagDeviceContribution(); >- for (int i = 0; i < availableDevices.length; i++) { >- if (jtagDeviceName.equals(availableDevices[i].getDeviceName())) { >- gdbJtagDevice = availableDevices[i].getDevice(); >+ String jtagDeviceName = config.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, IGDBJtagConstants.DEFAULT_JTAG_DEVICE); //$NON-NLS-1$ >+ GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory.getInstance().getGDBJtagDeviceContribution(); >+ for (GDBJtagDeviceContribution availableDevice : availableDevices) { >+ if (jtagDeviceName.equals(availableDevice.getDeviceName())) { >+ gdbJtagDevice = availableDevice.getDevice(); > break; > } > } >Index: src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java,v >retrieving revision 1.7 >diff -u -r1.7 GDBJtagDebugger.java >--- src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java 22 Apr 2010 22:46:49 -0000 1.7 >+++ src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java 5 May 2010 23:49:55 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007 - 2008 QNX Software Systems and others. >+ * Copyright (c) 2007 - 2010 QNX Software Systems and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -16,9 +16,9 @@ > import java.io.File; > import java.util.ArrayList; > import java.util.List; >- > import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; > import org.eclipse.cdt.debug.core.CDebugCorePlugin; >+import org.eclipse.cdt.debug.core.CDebugUtils; > import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; > import org.eclipse.cdt.debug.core.cdi.ICDISession; > import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; >@@ -36,6 +36,7 @@ > import org.eclipse.cdt.debug.mi.core.command.MIGDBSetNewConsole; > import org.eclipse.cdt.debug.mi.core.output.MIInfo; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.MultiStatus; >@@ -111,15 +112,60 @@ > > List<String> commands = new ArrayList<String>(); > >- // hook up to remote target > if (submonitor.isCanceled()) { > throw new OperationCanceledException(); > } >+ >+ // execute symbol load >+ boolean doLoadSymbols = config.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS); >+ if (doLoadSymbols) { >+ String symbolsFileName = null; >+ // New setting in Helios. Default is true. Check for existence >+ // in order to support older launch configs >+ if (config.hasAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS) && >+ config.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS)) { >+ IPath programFile = CDebugUtils.verifyProgramPath(config); >+ if (programFile != null) { >+ symbolsFileName = programFile.toOSString(); >+ } >+ } >+ else { >+ symbolsFileName = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME); >+ if (symbolsFileName.length() > 0) { >+ symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName); >+ } >+ } >+ if (symbolsFileName == null) { >+ // The launch config GUI should prevent this from happening, but just in case >+ throw new CoreException(new Status( IStatus.ERROR, >+ Activator.getUniqueIdentifier(), >+ -1, Messages.getString("GDBJtagDebugger.err_no_sym_file"), null)); >+ } >+ >+ // Escape windows path separator characters TWICE, once for Java and once for GDB. >+ symbolsFileName = symbolsFileName.replace("\\", "\\\\"); >+ >+ String symbolsOffset = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET); >+ if (symbolsOffset.length() > 0) { >+ symbolsOffset = "0x" + symbolsOffset; >+ } >+ commands.clear(); >+ gdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands); >+ monitor.beginTask(Messages.getString("GDBJtagDebugger.loading_symbols"), 1); //$NON-NLS-1$ >+ executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(15)); >+ } >+ >+ if (submonitor.isCanceled()) { >+ throw new OperationCanceledException(); >+ } >+ >+ // hook up to remote target > boolean useRemote = config.getAttribute(IGDBJtagConstants.ATTR_USE_REMOTE_TARGET, IGDBJtagConstants.DEFAULT_USE_REMOTE_TARGET); > if (useRemote) { > submonitor.subTask(Messages.getString("GDBJtagDebugger.2")); //$NON-NLS-1$ > String ipAddress = config.getAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, IGDBJtagConstants.DEFAULT_IP_ADDRESS); > int portNumber = config.getAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, IGDBJtagConstants.DEFAULT_PORT_NUMBER); >+ commands.clear(); > gdbJtagDevice.doRemote(ipAddress, portNumber, commands); > executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(10)); > if (submonitor.isCanceled()) { >@@ -132,7 +178,7 @@ > submonitor.setWorkRemaining(80); // compensate for optional work above > > // Run device-specific code to reset the board >- if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, true)) { >+ if (config.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)) { > commands.clear(); > gdbJtagDevice.doReset(commands); > int defaultDelay = gdbJtagDevice.getDefaultDelay(); >@@ -142,7 +188,7 @@ > submonitor.setWorkRemaining(65); // compensate for optional work above > > // Run device-specific code to halt the board >- if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, true)) { >+ if (config.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)) { > commands.clear(); > gdbJtagDevice.doHalt(commands); > executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(15)); >@@ -155,31 +201,45 @@ > // execute load > boolean doLoad = config.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE); > if (doLoad) { >+ String imageFileName = null; >+ >+ // New setting in Helios. Default is true. Check for existence >+ // in order to support older launch configs >+ if (config.hasAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE) && >+ config.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE)) { >+ IPath programFile = CDebugUtils.verifyProgramPath(config); >+ if (programFile != null) { >+ imageFileName = programFile.toOSString(); >+ } >+ } >+ else { >+ imageFileName = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME); >+ if (imageFileName.length() > 0) { >+ imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName); >+ } >+ } >+ if (imageFileName == null) { >+ // The launch config GUI should prevent this from happening, but just in case >+ throw new CoreException(new Status( IStatus.ERROR, >+ Activator.getUniqueIdentifier(), >+ -1, Messages.getString("GDBJtagDebugger.err_no_img_file"), null)); >+ } >+ > // Escape windows path separator characters TWICE, once for Java and once for GDB. >- String imageFileName = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$ >- if (imageFileName.length() > 0) { >- monitor.beginTask(Messages.getString("GDBJtagDebugger.5"), 1); //$NON-NLS-1$ >- imageFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName).replace("\\", "\\\\"); >- String imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, ""); //$NON-NLS-2$ //$NON-NLS-4$ >- commands.clear(); >- gdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands); >- executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(20)); >+ imageFileName = imageFileName.replace("\\", "\\\\"); >+ >+ String imageOffset = config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); >+ if (imageOffset.length() > 0) { >+ imageOffset = (imageFileName.endsWith(".elf")) ? "" : "0x" + config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); > } >+ >+ commands.clear(); >+ gdbJtagDevice.doLoadImage(imageFileName, imageOffset, commands); >+ monitor.beginTask(Messages.getString("GDBJtagDebugger.loading_image"), 1); //$NON-NLS-1$ >+ executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(20)); > } > submonitor.setWorkRemaining(15); // compensate for optional work above > >- // execute symbol load >- boolean doLoadSymbols = config.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS); >- if (doLoadSymbols) { >- String symbolsFileName = config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, ""); //$NON-NLS-1$ >- if (symbolsFileName.length() > 0) { >- symbolsFileName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName).replace("\\", "\\\\"); >- String symbolsOffset = "0x" + config.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, ""); //$NON-NLS-2$ >- commands.clear(); >- gdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands); >- executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(15)); >- } >- } > } catch (OperationCanceledException e) { > if (launch != null && launch.canTerminate()) { > launch.terminate(); >@@ -212,7 +272,7 @@ > // Set program counter > boolean setPc = config.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER); > if (setPc) { >- String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$ >+ String pcRegister = config.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, config.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_PC_REGISTER)); //$NON-NLS-1$ > gdbJtagDevice.doSetPC(pcRegister, commands); > executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(20)); > } >@@ -222,7 +282,7 @@ > monitor.beginTask(Messages.getString("GDBJtagDebugger.18"), 1); //$NON-NLS-1$ > boolean setStopAt = config.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT); > if (setStopAt) { >- String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, ""); //$NON-NLS-1$ >+ String stopAt = config.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT); //$NON-NLS-1$ > commands.clear(); > gdbJtagDevice.doStopAt(stopAt, commands); > executeGDBScript(getGDBScript(commands), miSession, submonitor.newChild(20)); >@@ -249,7 +309,7 @@ > private void executeGDBScript(String script, MISession miSession, > IProgressMonitor monitor) throws CoreException { > // Try to execute any extra command >- if (script == null) >+ if (script == null || script.length() == 0) > return; > script = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(script); > String[] commands = script.split("\\r?\\n"); >@@ -292,7 +352,7 @@ > private IGDBJtagDevice getGDBJtagDevice (ILaunchConfiguration config) > throws CoreException, NullPointerException { > IGDBJtagDevice gdbJtagDevice = null; >- String jtagDeviceName = config.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$ >+ String jtagDeviceName = config.getAttribute(IGDBJtagConstants.ATTR_JTAG_DEVICE, IGDBJtagConstants.DEFAULT_JTAG_DEVICE); //$NON-NLS-1$ > GDBJtagDeviceContribution[] availableDevices = GDBJtagDeviceContributionFactory. > getInstance().getGDBJtagDeviceContribution(); > for (int i = 0; i < availableDevices.length; i++) { >@@ -313,4 +373,5 @@ > } > return sb.toString(); > } >+ > } >Index: src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java,v >retrieving revision 1.4 >diff -u -r1.4 GDBJtagLaunchConfigurationDelegate.java >--- src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java 14 Jun 2007 19:44:18 -0000 1.4 >+++ src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagLaunchConfigurationDelegate.java 5 May 2010 23:49:55 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007 QNX Software Systems and others. >+ * Copyright (c) 2007 - 2010 QNX Software Systems and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -10,11 +10,10 @@ > *******************************************************************************/ > package org.eclipse.cdt.debug.gdbjtag.core; > >-import java.io.File; >- > import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; > import org.eclipse.cdt.core.model.ICProject; > import org.eclipse.cdt.debug.core.CDIDebugModel; >+import org.eclipse.cdt.debug.core.CDebugUtils; > import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; > import org.eclipse.cdt.debug.core.cdi.CDIException; > import org.eclipse.cdt.debug.core.cdi.ICDISession; >@@ -48,10 +47,9 @@ > > if (mode.equals(ILaunchManager.DEBUG_MODE)) { > GDBJtagDebugger debugger = new GDBJtagDebugger(); >- ICProject project = verifyCProject(configuration); >- IPath exePath = verifyProgramPath(configuration); >- File exeFile = exePath != null ? exePath.toFile() : null; >- ICDISession session = debugger.createSession(launch, exeFile, submonitor.newChild(1)); >+ ICProject project = CDebugUtils.verifyCProject(configuration); >+ IPath exePath = CDebugUtils.verifyProgramPath(configuration); >+ ICDISession session = debugger.createSession(launch, null, submonitor.newChild(1)); > IBinaryObject exeBinary = null; > if ( exePath != null ) { > exeBinary = verifyBinary(project, exePath); >Index: src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java,v >retrieving revision 1.4 >diff -u -r1.4 IGDBJtagConstants.java >--- src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java 5 May 2008 21:07:00 -0000 1.4 >+++ src/org/eclipse/cdt/debug/gdbjtag/core/IGDBJtagConstants.java 5 May 2010 23:49:55 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007 - 2008 QNX Software Systems and others. >+ * Copyright (c) 2007 - 2010 QNX Software Systems and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -47,15 +47,33 @@ > public static final String ATTR_STOP_AT = Activator.PLUGIN_ID + ".stopAt"; //$NON-NLS-1$ > public static final String ATTR_SET_RESUME = Activator.PLUGIN_ID + ".setResume"; //$NON-NLS-1$ > public static final String ATTR_RUN_COMMANDS = Activator.PLUGIN_ID + ".runCommands"; //$NON-NLS-1$ >- >+ /** @since 7.0 */ public static final String ATTR_USE_PROJ_BINARY_FOR_IMAGE = Activator.PLUGIN_ID + ".useProjBinaryForImage"; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String ATTR_USE_FILE_FOR_IMAGE = Activator.PLUGIN_ID + ".useFileForImage"; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String ATTR_USE_PROJ_BINARY_FOR_SYMBOLS = Activator.PLUGIN_ID + ".useProjBinaryForSymbols"; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String ATTR_USE_FILE_FOR_SYMBOLS = Activator.PLUGIN_ID + ".useFileForSymbols"; //$NON-NLS-1$ >+ > public static final boolean DEFAULT_DO_RESET = true; > public static final boolean DEFAULT_DO_HALT = true; > public static final int DEFAULT_DELAY = 3; >- public static final boolean DEFAULT_LOAD_IMAGE = false; >- public static final boolean DEFAULT_LOAD_SYMBOLS = false; >+ public static final boolean DEFAULT_LOAD_IMAGE = true; >+ public static final boolean DEFAULT_LOAD_SYMBOLS = true; > public static final boolean DEFAULT_SET_PC_REGISTER = false; > public static final boolean DEFAULT_SET_STOP_AT = false; > public static final boolean DEFAULT_SET_RESUME = false; > public static final boolean DEFAULT_USE_DEFAULT_RUN = true; >- >+ >+ /** @since 7.0 */ public static final String DEFAULT_INIT_COMMANDS = ""; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String DEFAULT_IMAGE_FILE_NAME = ""; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String DEFAULT_SYMBOLS_FILE_NAME = ""; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String DEFAULT_RUN_COMMANDS = ""; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final boolean DEFAULT_USE_PROJ_BINARY_FOR_IMAGE = true; >+ /** @since 7.0 */ public static final boolean DEFAULT_USE_FILE_FOR_IMAGE = false; >+ /** @since 7.0 */ public static final boolean DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS = true; >+ /** @since 7.0 */ public static final boolean DEFAULT_USE_FILE_FOR_SYMBOLS = false; >+ /** @since 7.0 */ public static final String DEFAULT_IMAGE_OFFSET = ""; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String DEFAULT_SYMBOLS_OFFSET = ""; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String DEFAULT_PC_REGISTER = ""; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String DEFAULT_STOP_AT = ""; //$NON-NLS-1$ >+ /** @since 7.0 */ public static final String DEFAULT_JTAG_DEVICE = ""; //$NON-NLS-1$ >+ > } >Index: src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties,v >retrieving revision 1.3 >diff -u -r1.3 Message.properties >--- src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties 26 May 2009 21:40:34 -0000 1.3 >+++ src/org/eclipse/cdt/debug/gdbjtag/core/Message.properties 5 May 2010 23:49:55 -0000 >@@ -1,5 +1,5 @@ > ############################################################################### >-# Copyright (c) 2008 QNX Software Systems and others. >+# Copyright (c) 2008 - 2010 QNX Software Systems and others. > # All rights reserved. This program and the accompanying materials > # are made available under the terms of the Eclipse Public License v1.0 > # which accompanies this distribution, and is available at >@@ -15,5 +15,9 @@ > GDBJtagDebugger.21=GDB command: > GDBJtagDebugger.22=Failed command > GDBJtagDebugger.3=Executing init commands >-GDBJtagDebugger.5=Loading image >+GDBJtagDebugger.loading_image=Loading image >+GDBJtagDebugger.loading_symbols=Loading symbolics > src.common.No_answer=No answer >+ >+GDBJtagDebugger.err_no_sym_file=Symbolics loading was requested but file was not specified or not found. >+GDBJtagDebugger.err_no_img_file=Image loading was requested but file was not specified or not found. >Index: src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java,v >retrieving revision 1.3 >diff -u -r1.3 DefaultGDBJtagDeviceImpl.java >--- src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java 3 Dec 2008 18:50:24 -0000 1.3 >+++ src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java 5 May 2010 23:49:55 -0000 >@@ -72,8 +72,21 @@ > */ > public void doLoadImage(String imageFileName, String imageOffset, Collection commands) { > String file = escapeScpaces(imageFileName); >- String cmd = "restore " + file + " " + imageOffset; >- addCmd(commands, cmd); >+ >+ if (imageOffset.length() > 0) { >+ // 'restore' simply puts the program into memory. >+ addCmd(commands, "restore " + file + " " + imageOffset); >+ } >+ else { >+ // 'load' puts the program into memory and sets the PC. To see why >+ // we do this when no offset is specified, see >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=310304#c20 >+ addCmd(commands, "load " + file); >+ } >+ >+ // 'exec-file' specifies the program as the context for getting memory. >+ // Basically, it tells gdb "this is the program we'll be debugging" >+ addCmd(commands, "exec-file " + file); > } > > /* (non-Javadoc) >@@ -81,8 +94,12 @@ > */ > public void doLoadSymbol(String symbolFileName, String symbolOffset, Collection commands) { > String file = escapeScpaces(symbolFileName); >- String cmd = "add-sym " + file + " " + symbolOffset; >- addCmd(commands, cmd); >+ if (symbolOffset == null || (symbolOffset.length() == 0)) { >+ addCmd(commands, "symbol-file " + file); >+ } >+ else { >+ addCmd(commands, "add-sym " + file + " " + symbolOffset); >+ } > } > > protected String escapeScpaces(String file) { >#P org.eclipse.cdt.debug.gdbjtag.ui >Index: src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java,v >retrieving revision 1.4 >diff -u -r1.4 GDBJtagDSFDebuggerTab.java >--- src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java 27 Apr 2010 20:17:23 -0000 1.4 >+++ src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDSFDebuggerTab.java 5 May 2010 23:49:56 -0000 >@@ -141,7 +141,7 @@ > gdbCommand.setLayoutData(gd); > gdbCommand.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -199,7 +199,7 @@ > jtagDevice.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { > updateDeviceIpPort(jtagDevice.getText()); >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -211,7 +211,7 @@ > ipAddress.setLayoutData(gd); > ipAddress.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -228,7 +228,7 @@ > }); > portNumber.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > } >Index: src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java,v >retrieving revision 1.10 >diff -u -r1.10 GDBJtagDebuggerTab.java >--- src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java 16 Mar 2010 15:34:08 -0000 1.10 >+++ src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagDebuggerTab.java 5 May 2010 23:49:56 -0000 >@@ -146,7 +146,7 @@ > gdbCommand.setLayoutData(gd); > gdbCommand.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -186,7 +186,7 @@ > commandFactory.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { > commandFactoryChanged(); >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > } >@@ -201,7 +201,7 @@ > miProtocol = new Combo(comp, SWT.READ_ONLY | SWT.DROP_DOWN); > miProtocol.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > } >@@ -272,7 +272,7 @@ > jtagDevice.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { > updateDeviceIpPort(jtagDevice.getText()); >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -284,7 +284,7 @@ > ipAddress.setLayoutData(gd); > ipAddress.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -301,7 +301,7 @@ > }); > portNumber.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > } >Index: src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java,v >retrieving revision 1.8 >diff -u -r1.8 GDBJtagStartupTab.java >--- src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java 16 Mar 2010 15:34:08 -0000 1.8 >+++ src/org/eclipse/cdt/debug/gdbjtag/ui/GDBJtagStartupTab.java 5 May 2010 23:49:57 -0000 >@@ -15,7 +15,7 @@ > > import java.io.File; > >-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; >+import org.eclipse.cdt.debug.core.CDebugUtils; > import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.ResourcesPlugin; >@@ -33,6 +33,7 @@ > import org.eclipse.swt.events.ModifyListener; > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; > import org.eclipse.swt.events.VerifyEvent; > import org.eclipse.swt.events.VerifyListener; > import org.eclipse.swt.graphics.Image; >@@ -82,6 +83,16 @@ > boolean resume = false; > > Text runCommands; >+ >+ // New GUI added to address bug 310304 >+ private Button useProjectBinaryForImage; >+ private Button useFileForImage; >+ private Button useProjectBinaryForSymbols; >+ private Button useFileForSymbols; >+ private Label imageOffsetLabel; >+ private Label symbolsOffsetLabel; >+ private Label projBinaryLabel1; >+ private Label projBinaryLabel2; > > public String getName() { > return TAB_NAME; >@@ -170,7 +181,7 @@ > }); > delay.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -197,7 +208,7 @@ > initCommands.setLayoutData(gd); > initCommands.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent evt) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -231,15 +242,42 @@ > comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > comp.setLayout(layout); > >- Label imageLabel = new Label(comp, SWT.NONE); >- imageLabel.setText(Messages.getString("GDBJtagStartupTab.imageLabel_Text")); >+ SelectionListener radioButtonListener = new SelectionListener() { >+ public void widgetSelected(SelectionEvent e) { >+ updateLaunchConfigurationDialog(); >+ updateUseFileEnablement(); >+ } >+ public void widgetDefaultSelected(SelectionEvent e) { >+ } >+ }; >+ >+ useProjectBinaryForImage = new Button(comp, SWT.RADIO); >+ useProjectBinaryForImage.setText(Messages.getString("GDBJtagStartupTab.useProjectBinary_Label")); >+ useProjectBinaryForImage.setToolTipText(Messages.getString("GDBJtagStartupTab.useProjectBinary_ToolTip")); >+ gd = new GridData(); >+ gd.horizontalSpan = 1; >+ useProjectBinaryForImage.setLayoutData(gd); >+ useProjectBinaryForImage.addSelectionListener(radioButtonListener); >+ >+ projBinaryLabel1 = new Label(comp, SWT.NONE); >+ gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd.horizontalSpan = 3; >+ projBinaryLabel1.setLayoutData(gd); >+ >+ useFileForImage = new Button(comp, SWT.RADIO); >+ useFileForImage.setText(Messages.getString("GDBJtagStartupTab.useFile_Label")); >+ gd = new GridData(); >+ gd.horizontalSpan = 1; >+ useFileForImage.setLayoutData(gd); >+ useFileForImage.addSelectionListener(radioButtonListener); >+ > imageFileName = new Text(comp, SWT.BORDER); > gd = new GridData(GridData.FILL_HORIZONTAL); > gd.horizontalSpan = 1; > imageFileName.setLayoutData(gd); > imageFileName.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -257,7 +295,7 @@ > } > }); > >- Label imageOffsetLabel = new Label(comp, SWT.NONE); >+ imageOffsetLabel = new Label(comp, SWT.NONE); > imageOffsetLabel.setText(Messages.getString("GDBJtagStartupTab.imageOffsetLabel_Text")); > imageOffset = new Text(comp, SWT.BORDER); > gd = new GridData(); >@@ -271,10 +309,11 @@ > }); > imageOffset.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >+ > loadSymbols = new Button(group, SWT.CHECK); > loadSymbols.setText(Messages.getString("GDBJtagStartupTab.loadSymbols_Text")); > gd = new GridData(); >@@ -292,16 +331,34 @@ > layout.numColumns = 4; > comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); > comp.setLayout(layout); >+ >+ useProjectBinaryForSymbols = new Button(comp, SWT.RADIO); >+ useProjectBinaryForSymbols.setText(Messages.getString("GDBJtagStartupTab.useProjectBinary_Label")); >+ useProjectBinaryForSymbols.setToolTipText(Messages.getString("GDBJtagStartupTab.useProjectBinary_ToolTip")); >+ gd = new GridData(); >+ gd.horizontalSpan = 1; >+ useProjectBinaryForSymbols.setLayoutData(gd); >+ useProjectBinaryForSymbols.addSelectionListener(radioButtonListener); >+ >+ projBinaryLabel2 = new Label(comp, SWT.NONE); >+ gd = new GridData(GridData.FILL_HORIZONTAL); >+ gd.horizontalSpan = 3; >+ projBinaryLabel2.setLayoutData(gd); >+ >+ useFileForSymbols = new Button(comp, SWT.RADIO); >+ useFileForSymbols.setText(Messages.getString("GDBJtagStartupTab.useFile_Label")); >+ gd = new GridData(); >+ gd.horizontalSpan = 1; >+ useFileForSymbols.setLayoutData(gd); >+ useFileForSymbols.addSelectionListener(radioButtonListener); > >- Label symbolLabel = new Label(comp, SWT.NONE); >- symbolLabel.setText(Messages.getString("GDBJtagStartupTab.symbolsLabel_Text")); > symbolsFileName = new Text(comp, SWT.BORDER); > gd = new GridData(GridData.FILL_HORIZONTAL); > gd.horizontalSpan = 1; > symbolsFileName.setLayoutData(gd); > symbolsFileName.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -319,7 +376,7 @@ > } > }); > >- Label symbolsOffsetLabel = new Label(comp, SWT.NONE); >+ symbolsOffsetLabel = new Label(comp, SWT.NONE); > symbolsOffsetLabel.setText(Messages.getString("GDBJtagStartupTab.symbolsOffsetLabel_Text")); > symbolsOffset = new Text(comp, SWT.BORDER); > gd = new GridData(); >@@ -333,12 +390,24 @@ > }); > symbolsOffset.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > > } > >+ private void updateUseFileEnablement() { >+ boolean enabled = loadImage.getSelection() && useFileForImage.getSelection(); >+ imageFileName.setEnabled(enabled); >+ imageFileBrowseWs.setEnabled(enabled); >+ imageFileBrowse.setEnabled(enabled); >+ >+ enabled = loadSymbols.getSelection() && useFileForSymbols.getSelection(); >+ symbolsFileName.setEnabled(enabled); >+ symbolsFileBrowseWs.setEnabled(enabled); >+ symbolsFileBrowse.setEnabled(enabled); >+ } >+ > public void createRunOptionGroup(Composite parent) { > Group group = new Group(parent, SWT.NONE); > GridLayout layout = new GridLayout(); >@@ -373,7 +442,7 @@ > }); > pcRegister.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -396,7 +465,7 @@ > stopAt.setLayoutData(gd); > stopAt.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > >@@ -419,18 +488,20 @@ > > private void loadImageChanged() { > boolean enabled = loadImage.getSelection(); >- imageFileName.setEnabled(enabled); >- imageFileBrowseWs.setEnabled(enabled); >- imageFileBrowse.setEnabled(enabled); >+ useProjectBinaryForImage.setEnabled(enabled); >+ useFileForImage.setEnabled(enabled); > imageOffset.setEnabled(enabled); >+ imageOffsetLabel.setEnabled(enabled); >+ updateUseFileEnablement(); > } > > private void loadSymbolsChanged() { > boolean enabled = loadSymbols.getSelection(); >- symbolsFileName.setEnabled(enabled); >- symbolsFileBrowseWs.setEnabled(enabled); >- symbolsFileBrowse.setEnabled(enabled); >+ useProjectBinaryForSymbols.setEnabled(enabled); >+ useFileForSymbols.setEnabled(enabled); > symbolsOffset.setEnabled(enabled); >+ symbolsOffsetLabel.setEnabled(enabled); >+ updateUseFileEnablement(); > } > > private void pcRegisterChanged() { >@@ -459,7 +530,7 @@ > runCommands.setLayoutData(gd); > runCommands.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent evt) { >- updateLaunchConfigurationDialog(); >+ scheduleUpdateJob(); > } > }); > } >@@ -474,40 +545,45 @@ > setMessage(null); > > if (loadImage.getSelection()) { >- if (imageFileName.getText().trim().length() == 0) { >- setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_not_specified")); >- return false; >- } >- >- String path; >- try { >- path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName.getText().trim()); >- IPath filePath = new Path(path); >- if (!filePath.toFile().exists()) { >+ if (!useProjectBinaryForImage.getSelection()) { >+ if (imageFileName.getText().trim().length() == 0) { >+ setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_not_specified")); >+ return false; >+ } >+ >+ try { >+ String path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(imageFileName.getText().trim()); >+ IPath filePath = new Path(path); >+ if (!filePath.toFile().exists()) { >+ setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_does_not_exist")); >+ return false; >+ } >+ } catch (CoreException e) { // string substitution throws this if expression doesn't resolve > setErrorMessage(Messages.getString("GDBJtagStartupTab.imageFileName_does_not_exist")); > return false; > } >- } catch (CoreException e) { >- Activator.getDefault().getLog().log(e.getStatus()); > } > } else { > setErrorMessage(null); > } > if (loadSymbols.getSelection()) { >- if (symbolsFileName.getText().trim().length() == 0) { >- setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_not_specified")); >- return false; >- } >- String path; >- try { >- path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName.getText().trim()); >- IPath filePath = new Path(path); >- if (!filePath.toFile().exists()) { >+ if (!useProjectBinaryForSymbols.getSelection()) { >+ if (symbolsFileName.getText().trim().length() == 0) { >+ setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_not_specified")); >+ return false; >+ } >+ >+ try { >+ String path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(symbolsFileName.getText().trim()); >+ IPath filePath = new Path(path); >+ if (!filePath.toFile().exists()) { >+ setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_does_not_exist")); >+ return false; >+ } >+ } catch (CoreException e) { // string substitution throws this if expression doesn't resolve > setErrorMessage(Messages.getString("GDBJtagStartupTab.symbolsFileName_does_not_exist")); > return false; > } >- } catch (CoreException e) { >- Activator.getDefault().getLog().log(e.getStatus()); > } > } else { > setErrorMessage(null); >@@ -540,72 +616,135 @@ > } > > /* (non-Javadoc) >- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) > */ >-// protected void updateLaunchConfigurationDialog() { >-// super.updateLaunchConfigurationDialog(); >-// isValid(getLaunchConfigurationDialog()); >-// } >- > public void initializeFrom(ILaunchConfiguration configuration) { > try { >- initCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, "")); //$NON-NLS-1$ >+ // Initialization Commands > doReset.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET)); >- doResetChanged(); >- doHalt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)); > delay.setText(String.valueOf(configuration.getAttribute(IGDBJtagConstants.ATTR_DELAY, IGDBJtagConstants.DEFAULT_DELAY))); >+ doHalt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT)); >+ initCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS)); >+ >+ // Load Image... > loadImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE)); >- loadImageChanged(); >- String defaultImageFileName = configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$ >- if (defaultImageFileName.equals("")) { >- defaultImageFileName = configuration.getWorkingCopy().getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); //$NON-NLS-1$ >- } >- imageFileName.setText(defaultImageFileName); >- imageOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, "")); //$NON-NLS-1$ >+ useProjectBinaryForImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE)); >+ useFileForImage.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_IMAGE)); >+ imageFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME)); >+ imageOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET)); >+ >+ //.. and Symbols > loadSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS)); >- loadSymbolsChanged(); >- symbolsFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, "")); //$NON-NLS-1$ >- symbolsOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, "")); //$NON-NLS-1$ >+ useProjectBinaryForSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS)); >+ useFileForSymbols.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_SYMBOLS)); >+ symbolsFileName.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME)); >+ symbolsOffset.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET)); >+ >+ // Runtime Options > setPcRegister.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER)); >- pcRegisterChanged(); >- pcRegister.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, "")); //$NON-NLS-1$ >+ pcRegister.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, IGDBJtagConstants.DEFAULT_PC_REGISTER)); > setStopAt.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT)); >- stopAtChanged(); >- stopAt.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, "")); //$NON-NLS-1$ >+ stopAt.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT)); > setResume.setSelection(configuration.getAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME)); >+ >+ // Run Commands >+ runCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS)); >+ >+ String programName = CDebugUtils.getProgramName(configuration); >+ if (programName != null) { >+ int lastSlash = programName.indexOf('\\'); >+ if (lastSlash >= 0) { >+ programName = programName.substring(lastSlash + 1); >+ } >+ lastSlash = programName.indexOf('/'); >+ if (lastSlash >= 0) { >+ programName = programName.substring(lastSlash + 1); >+ } >+ projBinaryLabel1.setText(programName); >+ projBinaryLabel2.setText(programName); >+ } >+ >+ doResetChanged(); >+ loadImageChanged(); >+ loadSymbolsChanged(); >+ pcRegisterChanged(); >+ stopAtChanged(); > resumeChanged(); >- runCommands.setText(configuration.getAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, "")); //$NON-NLS-1$) >+ updateUseFileEnablement(); >+ > } catch (CoreException e) { > Activator.getDefault().getLog().log(e.getStatus()); > } > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) >+ */ > public void performApply(ILaunchConfigurationWorkingCopy configuration) { >- configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, initCommands.getText()); >- configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, Integer.parseInt(delay.getText())); >+ >+ // Initialization Commands > configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, doReset.getSelection()); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, Integer.parseInt(delay.getText())); > configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, doHalt.getSelection()); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, initCommands.getText()); >+ >+ // Load Image... > configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, loadImage.getSelection()); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, useProjectBinaryForImage.getSelection()); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, useFileForImage.getSelection()); > configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, imageFileName.getText().trim()); > configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, imageOffset.getText()); >+ >+ //.. and Symbols > configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, loadSymbols.getSelection()); >- configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, symbolsOffset.getText()); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, useProjectBinaryForSymbols.getSelection()); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, useFileForSymbols.getSelection()); > configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, symbolsFileName.getText().trim()); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, symbolsOffset.getText()); >+ >+ // Runtime Options > configuration.setAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, setPcRegister.getSelection()); > configuration.setAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, pcRegister.getText()); > configuration.setAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, setStopAt.getSelection()); > configuration.setAttribute(IGDBJtagConstants.ATTR_STOP_AT, stopAt.getText()); > configuration.setAttribute(IGDBJtagConstants.ATTR_SET_RESUME, setResume.getSelection()); >+ >+ // Run Commands > configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, runCommands.getText()); > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) >+ */ > public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { >- configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, ""); //$NON-NLS-1$ >+ // Initialization Commands >+ configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, IGDBJtagConstants.DEFAULT_DO_RESET); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_DELAY, IGDBJtagConstants.DEFAULT_DELAY); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, IGDBJtagConstants.DEFAULT_DO_HALT); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, IGDBJtagConstants.DEFAULT_INIT_COMMANDS); >+ >+ // Load Image... > configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_IMAGE, IGDBJtagConstants.DEFAULT_LOAD_IMAGE); >- configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, ""); //$NON-NLS-1$ >- configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, ""); //$NON-NLS-1$ >- configuration.setAttribute(IGDBJtagConstants.ATTR_DO_RESET, true); >- configuration.setAttribute(IGDBJtagConstants.ATTR_DO_HALT, true); >- } >+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_IMAGE); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_IMAGE, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_IMAGE); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_FILE_NAME, IGDBJtagConstants.DEFAULT_IMAGE_FILE_NAME); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); >+ >+ //.. and Symbols >+ configuration.setAttribute(IGDBJtagConstants.ATTR_LOAD_SYMBOLS, IGDBJtagConstants.DEFAULT_LOAD_SYMBOLS); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_PROJ_BINARY_FOR_SYMBOLS); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_USE_FILE_FOR_SYMBOLS, IGDBJtagConstants.DEFAULT_USE_FILE_FOR_SYMBOLS); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_FILE_NAME, IGDBJtagConstants.DEFAULT_SYMBOLS_FILE_NAME); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET); >+ >+ // Runtime Options >+ configuration.setAttribute(IGDBJtagConstants.ATTR_SET_PC_REGISTER, IGDBJtagConstants.DEFAULT_SET_PC_REGISTER); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_PC_REGISTER, IGDBJtagConstants.DEFAULT_PC_REGISTER); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_SET_STOP_AT, IGDBJtagConstants.DEFAULT_SET_STOP_AT); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_STOP_AT, IGDBJtagConstants.DEFAULT_STOP_AT); >+ configuration.setAttribute(IGDBJtagConstants.ATTR_SET_RESUME, IGDBJtagConstants.DEFAULT_SET_RESUME); > >+ // Run Commands >+ configuration.setAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, IGDBJtagConstants.DEFAULT_RUN_COMMANDS); >+ } > } >Index: src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/jtag/org.eclipse.cdt.debug.gdbjtag.ui/src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties,v >retrieving revision 1.4 >diff -u -r1.4 JtagUi.properties >--- src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties 23 Apr 2010 14:18:42 -0000 1.4 >+++ src/org/eclipse/cdt/debug/gdbjtag/ui/JtagUi.properties 5 May 2010 23:49:57 -0000 >@@ -28,6 +28,9 @@ > GDBJtagStartupTab.symbolsFileBrowseWs_Title=Select symbols file > GDBJtagStartupTab.symbolsFileBrowse_Title=Select symbols file > GDBJtagStartupTab.symbolsOffsetLabel_Text=Symbols offset (hex): >+GDBJtagStartupTab.useProjectBinary_Label=Use project binary: >+GDBJtagStartupTab.useFile_Label=Use file: >+GDBJtagStartupTab.useProjectBinary_ToolTip=Use C/C++ application specified in the Main tab. > > GDBJtagStartupTab.runOptionGroup_Text=Runtime Options > GDBJtagStartupTab.setPcRegister_Text=Set program counter at (hex): >#P org.eclipse.cdt.launch >Index: src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java,v >retrieving revision 1.67 >diff -u -r1.67 AbstractCLaunchDelegate.java >--- src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java 7 Apr 2010 15:19:50 -0000 1.67 >+++ src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java 5 May 2010 23:49:58 -0000 >@@ -398,7 +398,7 @@ > */ > @Deprecated > protected IFile getProgramFile(ILaunchConfiguration config) throws CoreException { >- ICProject cproject = verifyCProject(config); >+ ICProject cproject = CDebugUtils.verifyCProject(config); > String fileName = CDebugUtils.getProgramName(config); > if (fileName == null) { > abort(LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_not_specified"), null, //$NON-NLS-1$ >@@ -417,62 +417,18 @@ > return programPath; > } > >+ /** >+ * @deprecated use {@link CDebugUtils#verifyCProject(ILaunchConfiguration)} >+ */ > protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException { >- String name = CDebugUtils.getProjectName(config); >- if (name == null) { >- abort(LaunchMessages.getString("AbstractCLaunchDelegate.C_Project_not_specified"), null, //$NON-NLS-1$ >- ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT); >- } >- ICProject cproject = CDebugUtils.getCProject(config); >- if (cproject == null) { >- IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(name); >- if (!proj.exists()) { >- abort( >- LaunchMessages.getFormattedString("AbstractCLaunchDelegate.Project_NAME_does_not_exist", name), null, //$NON-NLS-1$ >- ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); >- } else if (!proj.isOpen()) { >- abort(LaunchMessages.getFormattedString("AbstractCLaunchDelegate.Project_NAME_is_closed", name), null, //$NON-NLS-1$ >- ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); >- } >- abort(LaunchMessages.getString("AbstractCLaunchDelegate.Not_a_C_CPP_project"), null, //$NON-NLS-1$ >- ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT); >- } >- return cproject; >+ return CDebugUtils.verifyCProject(config); > } > >+ /** >+ * @deprecated use {@link CDebugUtils#verifyProgramPath(ILaunchConfiguration) >+ */ > protected IPath verifyProgramPath(ILaunchConfiguration config) throws CoreException { >- ICProject cproject = verifyCProject(config); >- IPath programPath = CDebugUtils.getProgramPath(config); >- if (programPath == null || programPath.isEmpty()) { >- abort(LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_not_specified"), null, //$NON-NLS-1$ >- ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM); >- } >- if (!programPath.isAbsolute()) { >- IPath location = cproject.getProject().getLocation(); >- if (location != null) { >- programPath = location.append(programPath); >- if (!programPath.toFile().exists()) { >- // Try the old way, which is required to support linked resources. >- IFile projFile = null; >- try { >- projFile = project.getFile(CDebugUtils.getProgramPath(config)); >- } >- catch (IllegalArgumentException exc) {} // thrown if relative path that resolves to a root file (e.g., "..\somefile") >- if (projFile != null && projFile.exists()) { >- programPath = projFile.getLocation(); >- } >- } >- } >- } >- if (!programPath.toFile().exists()) { >- abort( >- LaunchMessages.getString("AbstractCLaunchDelegate.Program_file_does_not_exist"), //$NON-NLS-1$ >- new FileNotFoundException( >- LaunchMessages.getFormattedString( >- "AbstractCLaunchDelegate.PROGRAM_PATH_not_found", programPath.toOSString())), //$NON-NLS-1$ >- ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST); >- } >- return programPath; >+ return CDebugUtils.verifyProgramPath(config); > } > > protected IPath verifyProgramFile(ILaunchConfiguration config) throws CoreException { >Index: src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java,v >retrieving revision 1.35 >diff -u -r1.35 CoreFileLaunchDelegate.java >--- src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java 27 Feb 2009 22:38:44 -0000 1.35 >+++ src/org/eclipse/cdt/launch/internal/CoreFileLaunchDelegate.java 5 May 2010 23:49:58 -0000 >@@ -53,8 +53,8 @@ > } > try { > monitor.worked(1); >- IPath exePath = verifyProgramPath(config); >- ICProject project = verifyCProject(config); >+ IPath exePath = CDebugUtils.verifyProgramPath(config); >+ ICProject project = CDebugUtils.verifyCProject(config); > IBinaryObject exeFile = verifyBinary(project, exePath); > > ICDebugConfiguration debugConfig = getDebugConfig(config); >Index: src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java,v >retrieving revision 1.13 >diff -u -r1.13 LocalAttachLaunchDelegate.java >--- src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java 27 Feb 2009 22:38:44 -0000 1.13 >+++ src/org/eclipse/cdt/launch/internal/LocalAttachLaunchDelegate.java 5 May 2010 23:49:58 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2006 QNX Software Systems and others. >+ * Copyright (c) 2004, 2010 QNX Software Systems and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -62,7 +62,7 @@ > } > try { > monitor.worked(1); >- ICProject cproject = verifyCProject(config); >+ ICProject cproject = CDebugUtils.verifyCProject(config); > IPath exePath = CDebugUtils.getProgramPath(config); > if (exePath != null && !exePath.isEmpty()) { > if (!exePath.isAbsolute()) { >Index: src/org/eclipse/cdt/launch/internal/LocalCDILaunchDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalCDILaunchDelegate.java,v >retrieving revision 1.11 >diff -u -r1.11 LocalCDILaunchDelegate.java >--- src/org/eclipse/cdt/launch/internal/LocalCDILaunchDelegate.java 29 Apr 2009 20:14:41 -0000 1.11 >+++ src/org/eclipse/cdt/launch/internal/LocalCDILaunchDelegate.java 5 May 2010 23:49:58 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2009 QNX Software Systems and others. >+ * Copyright (c) 2004, 2010 QNX Software Systems and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -23,6 +23,7 @@ > import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; > import org.eclipse.cdt.core.model.ICProject; > import org.eclipse.cdt.debug.core.CDIDebugModel; >+import org.eclipse.cdt.debug.core.CDebugUtils; > import org.eclipse.cdt.debug.core.ICDIDebugger; > import org.eclipse.cdt.debug.core.ICDIDebugger2; > import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; >@@ -80,7 +81,7 @@ > } > monitor.worked( 1 ); > try { >- IPath exePath = verifyProgramPath( config ); >+ IPath exePath = CDebugUtils.verifyProgramPath( config ); > File wd = getWorkingDirectory( config ); > if ( wd == null ) { > wd = new File( System.getProperty( "user.home", "." ) ); //$NON-NLS-1$ //$NON-NLS-2$ >@@ -130,8 +131,8 @@ > monitor.subTask( LaunchMessages.getString( "LocalCDILaunchDelegate.2" ) ); //$NON-NLS-1$ > ICDISession dsession = null; > try { >- IPath exePath = verifyProgramPath( config ); >- ICProject project = verifyCProject( config ); >+ IPath exePath = CDebugUtils.verifyProgramPath( config ); >+ ICProject project = CDebugUtils.verifyCProject( config ); > IBinaryObject exeFile = null; > if ( exePath != null ) { > exeFile = verifyBinary( project, exePath ); >@@ -201,11 +202,11 @@ > } > cancel( "", -1 ); //$NON-NLS-1$ > } >- IPath exePath = verifyProgramPath( config ); >+ IPath exePath = CDebugUtils.verifyProgramPath( config ); > if (exePath == null) { > exePath= getProgramPathForPid(pid); > } >- ICProject project = verifyCProject( config ); >+ ICProject project = CDebugUtils.verifyCProject( config ); > IBinaryObject exeFile = null; > if ( exePath != null ) { > exeFile = verifyBinary( project, exePath ); >@@ -273,7 +274,7 @@ > ICDebugConfiguration debugConfig = getDebugConfig( config ); > String path = config.getAttribute( ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, (String)null ); > if ( path == null || path.length() == 0) { >- ICProject project = verifyCProject( config ); >+ ICProject project = CDebugUtils.verifyCProject( config ); > IPath corefile = promptForCoreFilePath( (IProject)project.getResource(), debugConfig ); > if ( corefile == null ) { > cancel( LaunchMessages.getString( "LocalCDILaunchDelegate.6" ), ICDTLaunchConfigurationConstants.ERR_NO_COREFILE ); //$NON-NLS-1$ >@@ -289,8 +290,8 @@ > cancel( "", -1 ); //$NON-NLS-1$ > } > >- IPath exePath = verifyProgramPath( config ); >- ICProject project = verifyCProject( config ); >+ IPath exePath = CDebugUtils.verifyProgramPath( config ); >+ ICProject project = CDebugUtils.verifyCProject( config ); > IBinaryObject exeFile = null; > if ( exePath != null ) { > exeFile = verifyBinary( project, exePath ); >@@ -329,8 +330,8 @@ > > private ICDISession launchOldDebugSession( ILaunchConfiguration config, ILaunch launch, ICDIDebugger debugger, IProgressMonitor monitor ) throws CoreException { > IBinaryObject exeFile = null; >- IPath exePath = verifyProgramPath( config ); >- ICProject project = verifyCProject( config ); >+ IPath exePath = CDebugUtils.verifyProgramPath( config ); >+ ICProject project = CDebugUtils.verifyCProject( config ); > if ( exePath != null ) { > exeFile = verifyBinary( project, exePath ); > } >@@ -338,7 +339,7 @@ > } > > private ICDISession launchDebugSession( ILaunchConfiguration config, ILaunch launch, ICDIDebugger2 debugger, IProgressMonitor monitor ) throws CoreException { >- IPath path = verifyProgramPath( config ); >+ IPath path = CDebugUtils.verifyProgramPath( config ); > File exeFile = path != null ? path.toFile() : null; > return debugger.createSession( launch, exeFile, monitor ); > } >Index: src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java,v >retrieving revision 1.15 >diff -u -r1.15 LocalRunLaunchDelegate.java >--- src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java 23 Jun 2006 17:26:17 -0000 1.15 >+++ src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java 5 May 2010 23:49:58 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2006 QNX Software Systems and others. >+ * Copyright (c) 2005, 2010 QNX Software Systems and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -18,6 +18,7 @@ > import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; > import org.eclipse.cdt.core.model.ICProject; > import org.eclipse.cdt.debug.core.CDIDebugModel; >+import org.eclipse.cdt.debug.core.CDebugUtils; > import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; > import org.eclipse.cdt.debug.core.ICDebugConfiguration; > import org.eclipse.cdt.debug.core.cdi.CDIException; >@@ -57,8 +58,8 @@ > } > try { > monitor.worked(1); >- IPath exePath = verifyProgramPath(config); >- ICProject project = verifyCProject(config); >+ IPath exePath = CDebugUtils.verifyProgramPath(config); >+ ICProject project = CDebugUtils.verifyCProject(config); > if (exePath != null) { > exeFile = verifyBinary(project, exePath); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
john.cortell
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 310304
:
166318
|
167065
|
167248
|
167385
|
167476
|
167477