# HG changeset patch # User john.dean.3@nokia.com # Date 1249925035 18000 # Node ID 5354388b2a6b6528de5692762c3d83362d3b7f92 # Parent 2ee12718a766c5f626112b63b5080e8f00805ae2 To support automated testing, added new attach to process launch configuration setting to support silently setting the process to attach to without displaying the process chooser dialog. diff -r 2ee12718a766 -r 5354388b2a6b 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 Aug 07 15:50:06 2009 -0500 +++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java Mon Aug 10 12:23:55 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$ diff -r 2ee12718a766 -r 5354388b2a6b 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 Aug 07 15:50:06 2009 -0500 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AttachLaunchDelegate.java Mon Aug 10 12:23:55 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.contentEquals("")) { + 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.getName().contains(choosenProcessName)) { + attachTarget = process; + break; + } + } + + return attachTarget; + } }