Merge from HEAD. Support for automated tests to select a process for an attach to process launch configuration without using the UI.
--- 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);
--- 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;
+ }
}