--- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java Mon Aug 10 10:47:20 2009 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java Mon Aug 10 14:45:48 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$
--- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AttachLaunchDelegate.java Mon Aug 10 10:47:20 2009 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/AttachLaunchDelegate.java Mon Aug 10 14:45:48 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;
+ }
}