# HG changeset patch # User john.dean.3@nokia.com # Date 1250005138 18000 # Node ID d40ec9228b9cc336524d13049423014ba65fc236 # Parent 1eb192be3ff40e5c2bbae9f120d21f83b1bda81c Merge from HEAD. Support for automated tests to select a process for an attach to process launch configuration without using the UI. diff -r 1eb192be3ff4 -r d40ec9228b9c 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 Fri Jul 31 10:46:14 2009 -0500 +++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java Tue Aug 11 10:38:58 2009 -0500 @@ -88,6 +88,7 @@ public static final int LCS_ExeTargetingRule_ExeList = 2; public static final int LCS_ExeTargetingRule_All = 3; public static final String LCS_ExecutableTargetingRule = PREFIX + ".LCS_ExecutableTargetingRule"; + public static final String AttachToProcessDialog_Selection = PREFIX + ".AttachToProcessName"; // Launch Type IDs private static final String LAUNCH_TYPE_PREFIX = "com.nokia.cdt.debug.launch."; //$NON-NLS-1$ @@ -427,6 +428,7 @@ public static void setRomImgTab(ILaunchConfigurationWorkingCopy configuration, IProject project) { + configuration.setAttribute( PreferenceConstants.J_PN_DebugNonXip, false); configuration.setAttribute( PreferenceConstants.J_PN_DownloadRomImage, false); configuration.setAttribute( PreferenceConstants.J_PN_RomImagePath, ""); //$NON-NLS-1$ configuration.setAttribute( PreferenceConstants.J_PN_DownloadAddress, 0); diff -r 1eb192be3ff4 -r d40ec9228b9c debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AttachLaunchDelegate.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AttachLaunchDelegate.java Fri Jul 31 10:46:14 2009 -0500 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AttachLaunchDelegate.java Tue Aug 11 10:38:58 2009 -0500 @@ -131,7 +131,13 @@ // Ask user to choose a process String defaultProcessName = exeFile.getPath().removeFileExtension().lastSegment(); - OSProcess attachTarget = chooseProcessTarget(processesOnTarget, defaultProcessName); + OSProcess attachTarget = null; + String choosenProcessTarget = config.getAttribute(SettingsData.AttachToProcessDialog_Selection, ""); + if (choosenProcessTarget.length() > 0) { + attachTarget = chooseProcessTargetNoUI(processesOnTarget, choosenProcessTarget); + } else { + attachTarget = chooseProcessTarget(processesOnTarget, defaultProcessName); + } if (attachTarget == null) { this.cancel(LaunchMessages.getString("LocalAttachLaunchDelegate.No_Process_ID_selected"), 0); //$NON-NLS-1$ @@ -195,4 +201,17 @@ return attachTarget; } + + private OSProcess chooseProcessTargetNoUI(final OSProcess[] processesOnTarget, final String choosenProcessName) { + attachTarget = null; + + for (OSProcess process : processesOnTarget) { + if (process.parseProcess().getProcessName().equals(choosenProcessName)) { + attachTarget = process; + break; + } + } + + return attachTarget; + } }