debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java
author stechong
Wed, 21 Jul 2010 12:11:48 -0500
branchC3_BUILDER_WORK
changeset 1657 03f5f8bf29b4
parent 1483 1480b95b4dab
parent 1590 39ba239eeb5c
child 1674 767ac4954317
permissions -rw-r--r--
Merge from default.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     1
/*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     3
* All rights reserved.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     8
*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    11
*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    12
* Contributors:
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    13
*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    14
* Description: 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    15
*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    16
*/
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    17
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    18
package com.nokia.cdt.debug.cw.symbian;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    19
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    20
import java.io.File;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    21
import java.io.IOException;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    22
import java.util.ArrayList;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    23
import java.util.HashMap;
1208
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
    24
import java.util.HashSet;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    25
import java.util.List;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    26
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    27
import org.eclipse.cdt.core.CCorePlugin;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    28
import org.eclipse.cdt.core.IBinaryParser;
1208
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
    29
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    30
import org.eclipse.cdt.core.ICExtensionReference;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    31
import org.eclipse.cdt.core.model.CModelException;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    32
import org.eclipse.cdt.core.model.CoreModel;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    33
import org.eclipse.cdt.core.model.IBinary;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    34
import org.eclipse.cdt.core.model.ICProject;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    35
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    36
import org.eclipse.core.resources.IProject;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    37
import org.eclipse.core.resources.IResource;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    38
import org.eclipse.core.runtime.CoreException;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    39
import org.eclipse.core.runtime.IPath;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    40
import org.eclipse.core.runtime.Path;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    41
import org.eclipse.debug.core.DebugPlugin;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    42
import org.eclipse.debug.core.ILaunchConfiguration;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    43
import org.eclipse.debug.core.ILaunchConfigurationType;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    44
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
1208
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
    45
import org.eclipse.debug.core.ILaunchDelegate;
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
    46
import org.eclipse.debug.core.ILaunchManager;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    47
import org.eclipse.jface.dialogs.MessageDialog;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    48
import org.eclipse.swt.widgets.Shell;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    49
import org.eclipse.ui.IWorkbenchWindow;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    50
import org.eclipse.ui.PlatformUI;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    51
import org.osgi.framework.Version;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    52
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    53
import com.freescale.cdt.debug.cw.core.ProcessFactory;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    54
import com.freescale.cdt.debug.cw.core.RemoteConnectionsTRKHelper;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    55
import com.freescale.cdt.debug.cw.core.settings.ConnectionTypeInfo;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    56
import com.freescale.cdt.debug.cw.core.settings.DebuggerCommonData;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    57
import com.freescale.cdt.debug.cw.core.settings.Utils;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    58
import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    59
import com.nokia.carbide.cdt.builder.EpocEngineHelper;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    60
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    61
import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    62
import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo;
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
    63
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo;
1483
1480b95b4dab Updated com.nokia.cdt.debug.cw.symbian to work with recently refactored ISymbianBuildContext.
stechong
parents: 1469
diff changeset
    64
import com.nokia.carbide.cpp.sdk.core.ISBSv1BuildContext;
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
    65
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    66
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
    67
import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    68
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    69
import com.nokia.carbide.remoteconnections.interfaces.IConnection;
1513
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
    70
import com.nokia.carbide.remoteconnections.internal.registry.Registry;
684
8e7900690341 Extract path-manipulation utilities into PathUtils, to correspond with the same classes in EDC.
Ed Swartz <ed.swartz@nokia.com>
parents: 664
diff changeset
    71
import com.nokia.cpp.internal.api.utils.core.PathUtils;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    72
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    73
import cwdbg.PreferenceConstants;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    74
1513
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
    75
@SuppressWarnings("restriction")
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    76
public class SettingsData {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    77
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    78
	// NOTE: Many of these constants are mirrored in 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    79
	// com.freescale.cdt.debug.cw.core.RemoteConnectionsTRKHelper
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    80
	// Due to dependency ordering, they can't be used directly
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    81
	// If you change any of these, please be sure to change them there, as well.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    82
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    83
	public static final String PREFIX = "com.nokia.cdt.debug.cw.symbian.SettingsData"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    84
	public static final String LaunchConfig_Emulator = PREFIX + ".LaunchConfig_Emulator"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    85
	public static final String LaunchConfig_AppTRK = PREFIX + ".LaunchConfig_AppTRK"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    86
	public static final String LaunchConfig_SysTRK = PREFIX + ".LaunchConfig_SysTRK"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    87
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    88
	public static final String ATTR_originalName = "originalName"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    89
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    90
	// Executable targeting
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    91
	public static final int LCS_ExeTargetingRule_AllInSDK = 0;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    92
	public static final int LCS_ExeTargetingRule_AllInProject = 1;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    93
	public static final int LCS_ExeTargetingRule_ExeList = 2;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    94
	public static final int LCS_ExeTargetingRule_All = 3;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    95
	public static final String LCS_ExecutableTargetingRule = PREFIX + ".LCS_ExecutableTargetingRule";
397
5354388b2a6b 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.
john.dean.3@nokia.com
parents: 256
diff changeset
    96
	public static final String AttachToProcessDialog_Selection = PREFIX + ".AttachToProcessName";
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    97
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    98
	// Launch Type IDs
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    99
	private static final String LAUNCH_TYPE_PREFIX = "com.nokia.cdt.debug.launch."; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   100
	public static final String CONTEXT_LAUNCH_TYPE_ID = LAUNCH_TYPE_PREFIX + "contextLaunch"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   101
	public static final String EMULATION_LAUNCH_TYPE_ID = LAUNCH_TYPE_PREFIX + "emulationLaunch"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   102
	public static final String APP_TRK_LAUNCH_TYPE_ID = LAUNCH_TYPE_PREFIX + "appTRKLaunch"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   103
	public static final String SYS_TRK_LAUNCH_TYPE_ID = LAUNCH_TYPE_PREFIX + "systemTRKLaunch"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   104
	public static final String ATTACH_LAUNCH_TYPE_ID = LAUNCH_TYPE_PREFIX + "attachLaunch"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   105
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   106
	//================ Shadowed CW Preference Panels =================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   107
	// These match prefs in a pref panel that exist in the CodeWarrior IDE. The names
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   108
	// have to match exactly the name of the fields in the C++ pref struct.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   109
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   110
	// Utility method: forms Shadowed Pref panel Name (the panel name shared with backend).
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   111
	private static String SPN(String cwPanelName, String cwPrefName)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   112
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   113
		return Utils.formShadowedPrefName(cwPanelName, cwPrefName);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   114
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   115
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   116
	//---< Serial Communication Panel> -------------------
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   117
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   118
	public static final String spn_SerialComm = "Serial Communications"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   119
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   120
	public static final String spn_SerialComm_port= SPN(spn_SerialComm, "port"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   121
	public static final String spn_SerialComm_rate= SPN(spn_SerialComm, "rate"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   122
	public static final String spn_SerialComm_databits= SPN(spn_SerialComm, "databits"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   123
	public static final String spn_SerialComm_stopbits= SPN(spn_SerialComm, "stopbits"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   124
	public static final String spn_SerialComm_parity= SPN(spn_SerialComm, "parity"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   125
	public static final String spn_SerialComm_flowcontrol= SPN(spn_SerialComm, "flowcontrol"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   126
	public static final String spn_SerialComm_logdata= SPN(spn_SerialComm, "logdata"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   127
	public static final String spn_SerialComm_serialConn= SPN(spn_SerialComm, "serial"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   128
	public static final String spn_SerialComm_xtiConn= SPN(spn_SerialComm, "tcpip"); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   129
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   130
	//================= End of Shadowed panels ===========================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   131
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   132
	public static final String TARGET_PATH_INCLUDES_FILENAME = "TARGET_PATH_INCLUDES_FILENAME"; //$NON-NLS-1$
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   133
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   134
	public static final int J_PN_TrkTimeout_Default = 2000;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   135
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   136
	private static String[] exceptionPropertyNames = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   137
	private static IPath mainExeTargetPath = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   138
	private static IPath mainExeHostPath = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   139
	private static IPath mainExeWorkspaceRelativeMMPPath = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   140
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   141
	public static String[] getExceptionPropertyNames()
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   142
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   143
		if (exceptionPropertyNames == null)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   144
		{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   145
			final String[] exceptionPrefNames = { "exc_CONTROL_C", //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   146
				"exc_FLT_INEXACT_RESULT", "exc_CONTROL_BREAK", //$NON-NLS-1$ //$NON-NLS-2$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   147
				"exc_FLT_INVALID_OPERATION", "exc_DATATYPE_MISALIGNMENT", //$NON-NLS-1$ //$NON-NLS-2$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   148
				"exc_FLT_STACK_CHECK", "exc_ACCESS_VIOLATION", "exc_FLT_OVERFLOW", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   149
				"exc_IN_PAGE_ERROR", "exc_FLT_UNDERFLOW", "exc_NO_MEMORY", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   150
				"exc_INT_DIVIDE_BY_ZERO", "exc_ILLEGAL_INSTRUCTION", //$NON-NLS-1$ //$NON-NLS-2$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   151
				"exc_INT_OVERFLOW", "exc_NONCONTINUABLE_EXCEPTION", //$NON-NLS-1$ //$NON-NLS-2$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   152
				"exc_PRIV_INSTRUCTION", "exc_INVALID_DISPOSITION", //$NON-NLS-1$ //$NON-NLS-2$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   153
				"exc_STACK_OVERFLOW", "exc_ARRAY_BOUNDS_EXCEEDED", //$NON-NLS-1$ //$NON-NLS-2$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   154
				"exc_DLL_NOT_FOUND", "exc_FLT_DENORMAL_OPERAND", //$NON-NLS-1$ //$NON-NLS-2$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   155
				"exc_DLL_INIT_FAIL", "exc_FLT_DIVIDE_BY_ZERO", "exc_MS_CPLUS" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   156
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   157
		};
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   158
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   159
			exceptionPropertyNames = new String[exceptionPrefNames.length];
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   160
			for (int i = 0; i < exceptionPrefNames.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   161
				final String cwPanelName = "x86 Exceptions Panel"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   162
				exceptionPropertyNames[i] = Utils.formShadowedPrefName(cwPanelName, exceptionPrefNames[i]);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   163
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   164
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   165
		return exceptionPropertyNames;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   166
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   167
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   168
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   169
	static private void addSymbianSDKMapping(String epocRoot, ILaunchConfigurationWorkingCopy configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   170
		if (epocRoot.length() > 0 && new File(epocRoot).exists())
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   171
			configuration.setAttribute(SymbianPlugin.Epoc_Root, epocRoot);
1099
88ab187cbeb8 Refactor source mapping to com.nokia.cdt.debug.common plugin
timkelly
parents: 822
diff changeset
   172
	}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   173
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   174
	static public void addSymbianSDKMapping(Path executable, ILaunchConfigurationWorkingCopy configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   175
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   176
		String epocRoot = "";
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   177
		String[] segs = executable.segments();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   178
		for (int i = 0; i < segs.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   179
			if (segs[i].equalsIgnoreCase("epoc32"))
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   180
				epocRoot = executable.removeLastSegments(segs.length - i).toOSString();				
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   181
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   182
		addSymbianSDKMapping(epocRoot, configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   183
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   184
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   185
	static public void addSymbianSDKMapping(IProject project, ILaunchConfigurationWorkingCopy configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   186
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   187
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   188
			if (cpi == null){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   189
				try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   190
					String exeLocation = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   191
					Path exePath = new Path(exeLocation);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   192
					addSymbianSDKMapping(exePath, configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   193
				} catch (CoreException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   194
					e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   195
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   196
			}else{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   197
				String epocRoot = cpi.getDefaultConfiguration().getSDK().getEPOCROOT();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   198
				addSymbianSDKMapping(epocRoot, configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   199
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   200
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   201
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   202
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   203
	private static IBinary setProgramNameToFirstBinary(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   204
    	List<IBinary> applicableBinaries = getApplicableBinaries(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   205
		IBinary binaryToUse = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   206
		// try to find an exe to use
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   207
		for (IBinary binary : applicableBinaries) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   208
			if (binary.isExecutable()) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   209
				binaryToUse = binary;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   210
				break;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   211
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   212
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   213
		// if none, use the first in the list
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   214
		if (binaryToUse == null && !applicableBinaries.isEmpty())
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   215
			binaryToUse = applicableBinaries.get(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   216
		if (binaryToUse != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   217
			IPath location = binaryToUse.getResource().getLocation();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   218
			configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, location.toOSString());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   219
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   220
		return binaryToUse;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   221
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   222
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   223
	private static List<IBinary> getApplicableBinaries(ILaunchConfiguration configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   224
		List<IBinary> applicableBinaries = new ArrayList<IBinary>();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   225
		boolean isEmulatorConfig = isEmulatorConfiguration(configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   226
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   227
			ICProject cProject = CoreModel.getDefault().create(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   228
			if (cProject != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   229
				IBinary[] binaries = cProject.getBinaryContainer().getBinaries();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   230
				for (int i = 0; i < binaries.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   231
					IPath path = getCanonicalPath(binaries[i].getResource().getLocation());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   232
					int numSegs = path.segmentCount();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   233
					if (numSegs >= 3) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   234
						if (isEmulatorConfig == "WINSCW".equalsIgnoreCase(path.segment(numSegs - 3)))
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   235
							applicableBinaries.add(binaries[i]);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   236
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   237
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   238
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   239
		} catch (CModelException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   240
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   241
			displayWarningDialog(Messages.getString("SettingsData.38")); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   242
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   243
		return applicableBinaries;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   244
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   245
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   246
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   247
	public static void setEmulationMainTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   248
		//======== Emulator: main tab ======================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   249
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   250
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   251
			String projectName = project.getName();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   252
			configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   253
			configuration.setMappedResources( new IResource[] { project });
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   254
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   255
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   256
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   257
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   258
				String configName = projectName + " " + buildConfig.getDisplayString(); //$NON-NLS-1$
1513
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   259
				setLaunchConfigurationName(configuration, configName);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   260
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   261
				// make sure the selected build configuration of the current project
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   262
				// is an emulator build, otherwise warn them that we can't set default values.
1483
1480b95b4dab Updated com.nokia.cdt.debug.cw.symbian to work with recently refactored ISymbianBuildContext.
stechong
parents: 1469
diff changeset
   263
				if (buildConfig.getPlatformString().compareTo(ISBSv1BuildContext.EMULATOR_PLATFORM) == 0) {
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   264
					configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, mainExeHostPath == null ? "" : mainExeHostPath.toOSString());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   265
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   266
					if (isEmulatorRequired(buildConfig, mainExeHostPath, mainExeWorkspaceRelativeMMPPath)) {
1469
5844e41d8bc7 Fixed errors in com.nokia.cdt.debug.cw.symbian due to ISymbianSDK refactoring.
stechong
parents: 1445
diff changeset
   267
						String winscwudeb = buildConfig.getSDK().getReleaseRoot().toOSString() + File.separator + "WINSCW" + File.separator + buildConfig.getTargetString(); //$NON-NLS-1$ //$NON-NLS-2$
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   268
						String emulatorPath = winscwudeb + File.separator + "epoc.exe"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   269
						configuration.setAttribute(DebuggerCommonData.Host_App_Path, getCanonicalPath(emulatorPath));			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   270
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   271
					else if (mainExeHostPath != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   272
						configuration.setAttribute(DebuggerCommonData.Host_App_Path, getCanonicalPath(mainExeHostPath.toOSString()));			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   273
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   274
				} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   275
					displayWarningDialog(Messages.getString("SettingsData.37")); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   276
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   277
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   278
			else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   279
				if (mainExeHostPath != null && !mainExeHostPath.isEmpty()) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   280
					configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, mainExeHostPath.toOSString()); 				 					
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   281
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   282
					// launch the emulator for non-"exe" files
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   283
					if ("exe".equalsIgnoreCase(mainExeHostPath.getFileExtension())) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   284
	 					configuration.setAttribute(DebuggerCommonData.Host_App_Path, mainExeHostPath.toOSString());			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   285
					} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   286
	   					String emulatorPath = mainExeHostPath.removeLastSegments(1).append("epoc.exe").toOSString();//$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   287
	 					configuration.setAttribute(DebuggerCommonData.Host_App_Path, getCanonicalPath(emulatorPath));			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   288
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   289
				} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   290
					IBinary binary = setProgramNameToFirstBinary(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   291
					if (binary.isExecutable()) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   292
						configuration.setAttribute(DebuggerCommonData.Host_App_Path, 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   293
								getCanonicalPath(binary.getResource().getLocation()).toOSString());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   294
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   295
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   296
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   297
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   298
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   299
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   300
	private static String getCanonicalPath(String path) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   301
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   302
			return new File(path).getCanonicalPath();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   303
		} catch (IOException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   304
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   305
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   306
		return path;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   307
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   308
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   309
	private static IPath getCanonicalPath(IPath path) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   310
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   311
			if (path == null)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   312
				return null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   313
			return new Path(path.toFile().getCanonicalPath());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   314
		} catch (IOException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   315
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   316
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   317
		return path;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   318
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   319
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   320
	public static void setEmulationDebuggerTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   321
		//============= Emulator debugger tab ============================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   322
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   323
		configuration.setAttribute( DebugPlugin.ATTR_PROCESS_FACTORY_ID, ProcessFactory.ID );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   324
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   325
		configuration.setAttribute( PreferenceConstants.J_PN_StopAtMainSymbol, "E32Main" ); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   326
		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   327
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   328
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   329
		configuration.setAttribute( PreferenceConstants.J_PN_SymbolLoadingRule, PreferenceConstants.J_PV_SymbolLoadingRule_Auto);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   330
		configuration.setAttribute( PreferenceConstants.J_PN_ViewProcessOutput, true);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   331
		configuration.setAttribute( PreferenceConstants.J_PN_ViewSystemMessage, false);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   332
		configuration.setAttribute( SymbianPlugin.DebugTraceLaunchSetting, true);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   333
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   334
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   335
	public static void setX86ExceptionsTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   336
		//======= Emulator: x86 Exceptions tab ===================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   337
		// 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   338
		String[] exceptionPropertyNames = getExceptionPropertyNames();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   339
		// turn off all exceptions by default as the new emulators hit
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   340
		// a bunch of recoverable exceptions while starting up
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   341
		for (int i = 0; i < exceptionPropertyNames.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   342
			configuration.setAttribute(exceptionPropertyNames[i], false);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   343
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   344
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   345
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   346
	public static void setTrkMainTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   347
		//===== TRK :  main tab =================================================== 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   348
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   349
		configuration.setAttribute(PreferenceConstants.J_PN_RemoteProcessToLaunch, ""); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   350
		configuration.setAttribute(PreferenceConstants.J_PN_ProgramArguments, ""); //$NON-NLS-1$
1513
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   351
		configuration.setAttribute(RemoteConnectionsTRKHelper.CONNECTION_ATTRIBUTE, Registry.CURRENT_CONNECTION_ID);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   352
1208
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   353
	    HashSet<String> set = new HashSet<String>();
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   354
	    set.add(ILaunchManager.DEBUG_MODE);
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   355
	    try {
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   356
    	    ILaunchDelegate preferredDelegate = configuration.getPreferredDelegate(set);
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   357
    	    if (preferredDelegate == null) {
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   358
    	        if (configuration.getType().getIdentifier().equals(APP_TRK_LAUNCH_TYPE_ID)) {
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   359
    	        	configuration.setPreferredLaunchDelegate(set, "com.nokia.carbide.cpp.edc.launch.appTRKLaunchDelegate"); //$NON-NLS-1$
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   360
    	        } else if (configuration.getType().getIdentifier().equals(SYS_TRK_LAUNCH_TYPE_ID)) {
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   361
    	        	configuration.setPreferredLaunchDelegate(set, "com.nokia.carbide.cpp.edc.launch.systemTRKLaunchDelegate"); //$NON-NLS-1$
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   362
    	        } else if (configuration.getType().getIdentifier().equals(ATTACH_LAUNCH_TYPE_ID)) {
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   363
    	        	configuration.setPreferredLaunchDelegate(set, "com.nokia.carbide.cpp.edc.launch.attachLaunchDelegate"); //$NON-NLS-1$
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   364
                } 
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   365
    	    }
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   366
	    } catch (CoreException e) {}
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   367
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   368
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   369
			String projectName = project.getName();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   370
			configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   371
			configuration.setMappedResources( new IResource[] { project });
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   372
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   373
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   374
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   375
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   376
				String configName = projectName + " " + buildConfig.getDisplayString(); //$NON-NLS-1$
1513
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   377
				setLaunchConfigurationName(configuration, configName);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   378
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   379
				// make sure the selected build configuration of the current project is not an emulator build
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   380
				// otherwise warn them that we can't set default values.
1483
1480b95b4dab Updated com.nokia.cdt.debug.cw.symbian to work with recently refactored ISymbianBuildContext.
stechong
parents: 1469
diff changeset
   381
				if (buildConfig.getPlatformString().compareTo(ISBSv1BuildContext.EMULATOR_PLATFORM) != 0) {
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   382
					configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, mainExeHostPath == null ? "" : mainExeHostPath.toOSString());
684
8e7900690341 Extract path-manipulation utilities into PathUtils, to correspond with the same classes in EDC.
Ed Swartz <ed.swartz@nokia.com>
parents: 664
diff changeset
   383
					configuration.setAttribute(PreferenceConstants.J_PN_RemoteProcessToLaunch, mainExeTargetPath == null ? "" : PathUtils.convertPathToWindows(mainExeTargetPath));
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   384
				} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   385
					displayWarningDialog(Messages.getString("SettingsData.37")); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   386
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   387
			} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   388
				IBinary binary = setProgramNameToFirstBinary(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   389
				String exeName = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   390
				if (mainExeHostPath != null)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   391
					exeName = mainExeHostPath.lastSegment();
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   392
				else if (binary != null && binary.isExecutable())
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   393
					exeName = binary.getResource().getLocation().lastSegment();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   394
				if (exeName != null)	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   395
					configuration.setAttribute(PreferenceConstants.J_PN_RemoteProcessToLaunch, "C:\\sys\\bin\\" + exeName); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   396
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   397
		}	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   398
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   399
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   400
	public static void setStopModeMainTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   401
		//===== StopMode :  main tab =================================================== 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   402
		//		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   403
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   404
			String projectName = project.getName();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   405
			configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   406
			configuration.setMappedResources( new IResource[] { project });
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   407
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   408
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   409
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   410
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   411
				String configName = projectName + " " + buildConfig.getDisplayString(); //$NON-NLS-1$
1513
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   412
				setLaunchConfigurationName(configuration, configName);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   413
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   414
				// make sure the selected build configuration of the current project is not an emulator build
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   415
				// otherwise warn them that we can't set default values.
1483
1480b95b4dab Updated com.nokia.cdt.debug.cw.symbian to work with recently refactored ISymbianBuildContext.
stechong
parents: 1469
diff changeset
   416
				if (buildConfig.getPlatformString().compareTo(ISBSv1BuildContext.EMULATOR_PLATFORM) != 0) {
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   417
					configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, mainExeHostPath == null ? "" : mainExeHostPath.toOSString());					
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   418
				} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   419
					displayWarningDialog(Messages.getString("SettingsData.37")); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   420
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   421
			} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   422
				setProgramNameToFirstBinary(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   423
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   424
		}	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   425
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   426
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   427
	public static void setTrkDebuggerTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   428
		//======  TRK:  debugger tab ================================================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   429
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   430
		configuration.setAttribute( DebugPlugin.ATTR_PROCESS_FACTORY_ID, ProcessFactory.ID );			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   431
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   432
		configuration.setAttribute( PreferenceConstants.J_PN_StopAtMainSymbol, "E32Main" ); //$NON-NLS-1$
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   433
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   434
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   435
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false );
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   436
		configuration.setAttribute( PreferenceConstants.J_PN_ViewUnframedData, true );
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   437
		configuration.setAttribute( PreferenceConstants.J_PN_ViewCommMessages, false );
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   438
		configuration.setAttribute( PreferenceConstants.J_PN_DefaultInstructionSet, PreferenceConstants.J_PV_DefaultInstructionSet_Auto );
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   439
		configuration.setAttribute( PreferenceConstants.J_PN_TRKMessageTimeout, J_PN_TrkTimeout_Default );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   440
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   441
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   442
	public static void setStopModeDebuggerTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   443
		//======  Stop Mode:  debugger tab ================================================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   444
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   445
		configuration.setAttribute( DebugPlugin.ATTR_PROCESS_FACTORY_ID, ProcessFactory.ID );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   446
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   447
		configuration.setAttribute( PreferenceConstants.J_PN_StopAtMainSymbol, "E32Main" ); //$NON-NLS-1$
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   448
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   449
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   450
		configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false );
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   451
		configuration.setAttribute( PreferenceConstants.J_PN_RomImgStartAddress , 0);
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   452
		configuration.setAttribute( PreferenceConstants.J_PN_DebugRunFromStart, PreferenceConstants.J_PV_DebugRunFromStart_Debug);
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   453
		configuration.setAttribute( PreferenceConstants.J_PN_DefaultInstructionSet, PreferenceConstants.J_PV_DefaultInstructionSet_Auto );
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   454
		configuration.setAttribute( PreferenceConstants.J_PN_TargetProcessor, 8);
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   455
		configuration.setAttribute( PreferenceConstants.J_PN_RunTargetInitFile, false);
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   456
		configuration.setAttribute( PreferenceConstants.J_PN_TargetInitFilePath, ""); //$NON-NLS-1$
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   457
		configuration.setAttribute( PreferenceConstants.J_PN_RunMemConfigFile, false);
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   458
		configuration.setAttribute( PreferenceConstants.J_PN_MemConfigFilePath, ""); //$NON-NLS-1$
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   459
		configuration.setAttribute( PreferenceConstants.J_PN_ResetTarget, false);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   460
	}
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   461
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   462
	public static void setSerialConnTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   463
		//======== Serial Connection Tab =====================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   464
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   465
		configuration.setAttribute(PreferenceConstants.J_PN_TrkConnectionType, PreferenceConstants.J_PV_TrkConnectionType_Serial);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   466
		configuration.setAttribute(RemoteConnectionsTRKHelper.USES_REMOTE_CONNECTIONS_ATTRIBUTE, true);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   467
		IConnection defaultConnection = RemoteConnectionsTRKHelper.getFirstCompatibleConnection();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   468
		if (defaultConnection != null)
753
bde477f39c26 fix bug with storing id for default connection
dadubrow
parents: 684
diff changeset
   469
			RemoteConnectionsTRKHelper.setRemoteConnectionAttribute(configuration, defaultConnection);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   470
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   471
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   472
	public static void setFileTransferTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   473
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   474
		//======== File Transfer tab ============================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   475
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   476
		configuration.setAttribute( PreferenceConstants.J_PN_FilesToTransfer, "" ); //$NON-NLS-1$
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   477
		configuration.setAttribute( TARGET_PATH_INCLUDES_FILENAME, "true" ); //$NON-NLS-1$
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   478
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   479
		// only do this for system TRK configurations
200
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   480
		if (project != null) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   481
			
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   482
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   483
			if (cpi != null) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   484
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   485
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   486
				String defaultTargetPath = "C:\\"; //$NON-NLS-1$
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   487
				if (buildConfig.getSDK().getSupportedFeatures().contains(ISymbianSDKFeatures.IS_EKA2)) {
200
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   488
					// C:\\sys\bin for eka2
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   489
					defaultTargetPath += "sys\\bin\\"; //$NON-NLS-1$
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   490
				}
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   491
				String prefsData = "";
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   492
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   493
				// we'll add all binaries that could be built by the config, but will only enabled those
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   494
				// that are actually being built.
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   495
				List<IPath> builtComponents = EpocEngineHelper.getComponentsBuiltByConifguration(buildConfig);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   496
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   497
				// add the binaries and any resource-type files generated by all mmp files in the project
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   498
				for (IPath mmp : EpocEngineHelper.getMMPFilesForBuildConfiguration(buildConfig)) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   499
					String enabled = builtComponents.contains(mmp) ? ",1," : ",0,";
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   500
					IPath hp = EpocEngineHelper.getHostPathForExecutable(buildConfig, mmp);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   501
					if (hp != null) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   502
						IPath tp = EpocEngineHelper.getTargetPathForExecutable(buildConfig, mmp);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   503
						if (tp == null) {
684
8e7900690341 Extract path-manipulation utilities into PathUtils, to correspond with the same classes in EDC.
Ed Swartz <ed.swartz@nokia.com>
parents: 664
diff changeset
   504
							tp = PathUtils.createPath(defaultTargetPath).append(hp.lastSegment());
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   505
						}
684
8e7900690341 Extract path-manipulation utilities into PathUtils, to correspond with the same classes in EDC.
Ed Swartz <ed.swartz@nokia.com>
parents: 664
diff changeset
   506
						prefsData += hp.toOSString() + "," + PathUtils.convertPathToWindows(tp) + enabled; //$NON-NLS-1$
200
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   507
					}
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   508
					
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   509
					HashMap<String, String> hostTargetRSRCMap = EpocEngineHelper.getHostAndTargetResources(buildConfig, mmp);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   510
					// Add resource files...
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   511
					for (String currHostRSRC : hostTargetRSRCMap.keySet()) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   512
						prefsData += currHostRSRC + "," + hostTargetRSRCMap.get(currHostRSRC) + new Path(currHostRSRC).lastSegment() + enabled; //$NON-NLS-1$
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   513
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   514
				}
200
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   515
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   516
				// check the project for image makefiles
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   517
				HashMap<String, String> hostTargetImagesMap = EpocEngineHelper.getHostAndTargetImages(buildConfig);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   518
				for (String currHostImg : hostTargetImagesMap.keySet()) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   519
					prefsData += currHostImg + "," + hostTargetImagesMap.get(currHostImg) + ",1,"; //$NON-NLS-1$ //$NON-NLS-2$
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   520
				}
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   521
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   522
				// Add the files to transfer to the pref
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   523
				configuration.setAttribute( PreferenceConstants.J_PN_FilesToTransfer, prefsData );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   524
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   525
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   526
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   527
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   528
	public static void setInstallationTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   529
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   530
		//=========== AppTRK Installation tab ==========================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   531
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   532
		configuration.setAttribute( PreferenceConstants.J_PN_SisFileHostPath, "" ); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   533
		configuration.setAttribute( PreferenceConstants.J_PN_SisFileTargetPath, "C:\\data\\" ); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   534
		configuration.setAttribute( PreferenceConstants.J_PN_AlwaysInstallSisFile, false );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   535
		configuration.setAttribute( PreferenceConstants.J_PN_HideInstallerUI, true );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   536
		configuration.setAttribute( PreferenceConstants.J_PN_InstallToDrive, 2 ); // C:
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   537
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   538
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   539
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   540
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   541
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   542
				List<ISISBuilderInfo> sisInfoList = cpi.getDefaultConfiguration().getSISBuilderInfoList();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   543
				if (sisInfoList != null && sisInfoList.size() > 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   544
					// grab the last one in case they are embedded earlier built sis files
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   545
					// in later built ones
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   546
					configuration.setAttribute(PreferenceConstants.J_PN_SisFileHostPath, sisInfoList.get(sisInfoList.size() - 1).getFinalSISFullPath().toOSString());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   547
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   548
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   549
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   550
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   551
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   552
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   553
	public static void setExecutablesTab(ILaunchConfigurationWorkingCopy configuration, String settingsGroup, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   554
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   555
		//======== Executables Tab =====================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   556
		// Defaults to all executables from the same SDK
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   557
		configuration.setAttribute( LCS_ExecutableTargetingRule, LCS_ExeTargetingRule_AllInSDK ); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   558
		configuration.setAttribute( PreferenceConstants.J_PN_ExecutablesToDebug, "" ); //$NON-NLS-1$
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   559
		configuration.setAttribute(	PreferenceConstants.J_PN_SymbolLoadingRule,	PreferenceConstants.J_PV_SymbolLoadingRule_Auto );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   560
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   561
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   562
	/**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   563
	 * There are "internal preferences" that are not visible to (hence not changeable by) users. 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   564
	 * We set the values for them for different launch configurations. But when we change any 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   565
	 * of the values by re-coding, the change won't be picked up by existing launch configurations.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   566
	 *      
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   567
	 * This function is supposed to fix that problem. It should be called on every debugger start.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   568
	 * 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   569
	 * Any internal preferences should be set here.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   570
	 * 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   571
	 */ 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   572
	public static void setInternalPreferences(ILaunchConfigurationWorkingCopy configuration, String settingsGroup)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   573
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   574
		// All but emulator debugger support OS Data View (kernel aware view) at present.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   575
		// 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   576
		if (settingsGroup.equals(LaunchConfig_Emulator)) 
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   577
			configuration.setAttribute( PreferenceConstants.J_PN_SupportOSView, false );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   578
		else
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   579
			configuration.setAttribute( PreferenceConstants.J_PN_SupportOSView, true );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   580
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   581
		if (settingsGroup.equals(LaunchConfig_AppTRK) || 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   582
			    settingsGroup.equals(LaunchConfig_SysTRK) ||
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   583
			    settingsGroup.equals(LaunchConfig_Emulator))
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   584
		{
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   585
			configuration.setAttribute( PreferenceConstants.J_PN_IsSystemModeDebug, false );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   586
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   587
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   588
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   589
	// a convenience function.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   590
	public static void setInternalPreferences(ILaunchConfiguration originalConfig, String settingsGroup)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   591
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   592
		ILaunchConfigurationWorkingCopy wc = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   593
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   594
			wc = originalConfig.getWorkingCopy();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   595
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   596
			if (wc == null)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   597
				return;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   598
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   599
			setInternalPreferences(wc, settingsGroup);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   600
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   601
			wc.doSave();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   602
		} catch (CoreException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   603
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   604
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   605
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   606
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   607
	public static void setDefaults(ILaunchConfigurationWorkingCopy configuration, String settingsGroup, IProject project)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   608
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   609
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   610
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   611
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   612
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   613
				// get the list of binaries that are being built for the build config and their corresponding mmp's
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   614
				List<IPath> exePaths = new ArrayList<IPath>(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   615
				List<IPath> mmpPaths = new ArrayList<IPath>(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   616
				EpocEngineHelper.getPathToAllExecutables(buildConfig, new ArrayList<IPath>(), exePaths, new ArrayList<IPath>(), mmpPaths);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   617
				if (exePaths.size() > 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   618
					// pick the first exe in the list, otherwise the first binary in the list
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   619
					IPath exePath = exePaths.get(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   620
					IPath mmpPath = mmpPaths.get(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   621
					for (int i=0; i<exePaths.size(); i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   622
						String fileExt = exePaths.get(i).getFileExtension();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   623
						if (fileExt != null && fileExt.compareToIgnoreCase("exe") == 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   624
							exePath = exePaths.get(i);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   625
							mmpPath = mmpPaths.get(i);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   626
							break;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   627
						}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   628
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   629
					
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   630
					setDefaults(configuration, settingsGroup, project, mmpPath, exePath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   631
					return;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   632
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   633
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   634
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   635
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   636
		setDefaults(configuration, settingsGroup, project, null, null);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   637
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   638
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   639
	/**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   640
	 * Sets the default values for the launch configuration.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   641
	 * @param configuration
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   642
	 * @param settingsGroup
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   643
	 * @param project
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   644
	 * @param workspaceRelativeMMPPath should not be null for Carbide project (but can be for debug only projects)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   645
	 * @param mainExePath should be null for Carbide projects but should not be null for debug projects
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   646
	 */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   647
	public static void setDefaults(ILaunchConfigurationWorkingCopy configuration, String settingsGroup, IProject project, IPath workspaceRelativeMMPPath, IPath mainExePath)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   648
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   649
		// set the main executable target and host path here, so that we don't have to call into the EPOC engine every time.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   650
		// calling into EPOC engine every time could be expensive for large projects..
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   651
		mainExeHostPath = getCanonicalPath(mainExePath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   652
		mainExeTargetPath = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   653
		mainExeWorkspaceRelativeMMPPath = workspaceRelativeMMPPath;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   654
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   655
		if (workspaceRelativeMMPPath != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   656
			if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   657
				ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   658
				if (cpi != null) {			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   659
					ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   660
664
18b0c24adafe Fix more path conversion issues with Symbian launch
Ed Swartz <ed.swartz@nokia.com>
parents: 419
diff changeset
   661
					// do not canonicalize
18b0c24adafe Fix more path conversion issues with Symbian launch
Ed Swartz <ed.swartz@nokia.com>
parents: 419
diff changeset
   662
					mainExeTargetPath = EpocEngineHelper.getTargetPathForExecutable(buildConfig, workspaceRelativeMMPPath);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   663
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   664
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   665
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   666
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   667
		// this can be called from various places.  launch configurations can be created by clicking
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   668
		// the New button on the Eclipse launch configuration dialog, from our launch wizard, or from
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   669
		// the import executable wizard.  the import executable wizard creates a non-managed make project
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   670
		// and hence most of the logic below will not work.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   671
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   672
		// ==== common to all =======================================================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   673
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   674
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   675
		// Specify which debugger plugin to use.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   676
		configuration.setAttribute(DebuggerCommonData.Host_App_Path, ""); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   677
		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   678
		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); //$NON-NLS-1$
1513
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   679
		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING);
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   680
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   681
		if (project != null) {
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   682
			configuration.setMappedResources( new IResource[] { project });
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   683
		    ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
1590
39ba239eeb5c Fix bug where launch configs created from Executables view need to be saved after editing
Ed Swartz <ed.swartz@nokia.com>
parents: 1513
diff changeset
   684
		    configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, 
39ba239eeb5c Fix bug where launch configs created from Executables view need to be saved after editing
Ed Swartz <ed.swartz@nokia.com>
parents: 1513
diff changeset
   685
		    		cpi != null ? cpi.getDefaultBuildConfigName() : ""); //$NON-NLS-1$
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   686
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   687
		
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   688
		// set rom log file defaults.  do this for all launch types since it shouldn't hurt
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   689
		// and could be easy to miss some launch types that use this tab
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   690
		configuration.setAttribute(PreferenceConstants.J_PN_ParseRomLogFile, false);
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   691
		configuration.setAttribute(PreferenceConstants.J_PN_RomLogFilePath, ""); //$NON-NLS-1$
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   692
		configuration.setAttribute(PreferenceConstants.J_PN_SymbianKitEpoc32Dir, ""); //$NON-NLS-1$
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   693
		configuration.setAttribute(PreferenceConstants.J_PN_LogUnresolved, false);
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   694
1382
4ddf9fb521b2 removed old crash debugger.
wpaul
parents: 1208
diff changeset
   695
		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, SymbianDebugger.DEBUGGER_ID);
4ddf9fb521b2 removed old crash debugger.
wpaul
parents: 1208
diff changeset
   696
4ddf9fb521b2 removed old crash debugger.
wpaul
parents: 1208
diff changeset
   697
		setExecutablesTab(configuration, settingsGroup, project);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   698
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   699
		setInternalPreferences(configuration, settingsGroup);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   700
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   701
		if (settingsGroup.equals(LaunchConfig_Emulator)) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   702
			setEmulationMainTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   703
			setEmulationDebuggerTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   704
			setX86ExceptionsTab(configuration, project);			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   705
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   706
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   707
		if (settingsGroup.equals(LaunchConfig_AppTRK) || 
1382
4ddf9fb521b2 removed old crash debugger.
wpaul
parents: 1208
diff changeset
   708
			    settingsGroup.equals(LaunchConfig_SysTRK))
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   709
		{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   710
			setSerialConnTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   711
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   712
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   713
		if (settingsGroup.equals(LaunchConfig_AppTRK)) {
200
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   714
			setInstallationTab(configuration, project);
243
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   715
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   716
			// set this so it's there in the config and the apply button doesn't become
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   717
			// enabled when switching to the tab
245
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   718
			configuration.setAttribute(PreferenceConstants.J_PN_FilesToTransfer, ""); //$NON-NLS-1$
0575745dfefb fixed several problems with default launch values causing the apply button to become enabled when nothing had chaned - fixes bug #9275.
wpaul
parents: 243
diff changeset
   719
			configuration.setAttribute(TARGET_PATH_INCLUDES_FILENAME, "true"); //$NON-NLS-1$
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   720
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   721
		
243
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   722
		if (settingsGroup.equals(LaunchConfig_SysTRK)) {
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   723
			setFileTransferTab(configuration, project);
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   724
		}
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   725
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   726
		if (settingsGroup.equals(LaunchConfig_AppTRK) || settingsGroup.equals(LaunchConfig_SysTRK)) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   727
			setTrkMainTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   728
			setTrkDebuggerTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   729
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   730
			// TRK Debugging: specify TRK protocol plugin.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   731
			//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   732
			ConnectionTypeInfo connTI = new ConnectionTypeInfo(
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   733
					"Carbide TRK", // Internal ID //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   734
					"Symbian MetroTRK", // Display name //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   735
					spn_SerialComm); // Pref panel name
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   736
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   737
			DebuggerCommonData.setLaunchConfigConnSettings(
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   738
					configuration,
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   739
					connTI, 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   740
					"Symbian MetroTRK Protocol", //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   741
					""); // Protocol plugin name //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   742
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   743
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   744
		// Add the Symbian OS SDK Mapping.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   745
		addSymbianSDKMapping(project, configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   746
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   747
		configuration.setAttribute(ATTR_originalName, configuration.getName());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   748
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   749
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   750
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   751
	/**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   752
	 * Should the debugger launch the Symbian emulator (epoc.exe) as the debug process?
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   753
	 * This should be true in all cases except when the executable is an '.exe'.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   754
	 * These can be launched directly. However there is a problem doing this with OS9.1
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   755
	 * (it will fail after the first launch) so we still require the emulator in this case.	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   756
	 * @param buildConfig - current build config
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   757
	 * @return - true if we should launch epoc.exe as the debug process
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   758
	 */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   759
	public static boolean isEmulatorRequired(ICarbideBuildConfiguration buildConfig, IPath mainExeHostPath, IPath mainExeWorkspaceRelativeMMPPath) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   760
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   761
        ICarbideProjectInfo cpi = buildConfig.getCarbideProject();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   762
        
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   763
		if (cpi != null && mainExeHostPath != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   764
			if ("exe".equalsIgnoreCase(mainExeHostPath.getFileExtension()) && !isSharedLib(cpi.getProject(), mainExeHostPath)) { //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   765
				Version version = cpi.getDefaultConfiguration().getSDK().getOSVersion();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   766
				if (!(version.getMajor() == 9 && version.getMinor() == 1)) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   767
					return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   768
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   769
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   770
				// for 9.1 only and exe extension, check the UID2 and if it's 0x100039CE then
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   771
				// it needs the emulator, otherwise it doesn't.  see bugzilla #1822 for details.  this
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   772
				// is basically to work around an issue in the 9.1 emulator.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   773
				if (mainExeWorkspaceRelativeMMPPath != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   774
					String uid2 = EpocEngineHelper.getUID2(buildConfig, mainExeWorkspaceRelativeMMPPath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   775
					if (uid2 != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   776
						if (uid2.compareToIgnoreCase("0x100039CE") != 0) { //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   777
							return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   778
						}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   779
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   780
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   781
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   782
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   783
		return true;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   784
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   785
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   786
	public static boolean isEmulatorRequired(IPath mainExeHostPath)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   787
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   788
		List<ISymbianSDK> sdkList = new ArrayList<ISymbianSDK>();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   789
		sdkList = SDKCorePlugin.getSDKManager().getSDKList();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   790
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   791
		for (ISymbianSDK currSDK : sdkList){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   792
			if (new Path(currSDK.getEPOCROOT()).isPrefixOf(mainExeHostPath))
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   793
			{
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   794
			    // Apparently this only works correctly with the S60 emulator.
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   795
				ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   796
				if (sbsv1BuildInfo != null) {
1469
5844e41d8bc7 Fixed errors in com.nokia.cdt.debug.cw.symbian due to ISymbianSDK refactoring.
stechong
parents: 1445
diff changeset
   797
			        if (!sbsv1BuildInfo.isS60() &&
5844e41d8bc7 Fixed errors in com.nokia.cdt.debug.cw.symbian due to ISymbianSDK refactoring.
stechong
parents: 1445
diff changeset
   798
			        	!currSDK.getFamily().equalsIgnoreCase(ISBSv1BuildInfo.TECHVIEW_FAMILY_ID))
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   799
			        	return true;
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   800
				}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   801
		        
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   802
				if ("exe".equalsIgnoreCase(mainExeHostPath.getFileExtension())) { //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   803
					Version version = currSDK.getOSVersion();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   804
					if (!(version.getMajor() == 9 && version.getMinor() == 1)) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   805
						return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   806
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   807
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   808
				
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   809
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   810
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   811
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   812
		return true;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   813
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   814
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   815
	// Check if the given file is a shared library (DLL or APP in Symbian ).
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   816
	//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   817
	static public boolean isSharedLib(IProject project, IPath exePath) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   818
		int fileType;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   819
		ICExtensionReference[] parserRef;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   820
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   821
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   822
			parserRef = CCorePlugin.getDefault().getBinaryParserExtensions(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   823
		} catch (Exception e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   824
			return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   825
		};
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   826
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   827
		for (int i = 0; i < parserRef.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   828
			try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   829
				IBinaryParser parser = (IBinaryParser)parserRef[i].createExtension();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   830
				IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   831
				if (exe != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   832
					fileType = exe.getType();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   833
					return fileType == IBinaryParser.IBinaryFile.SHARED;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   834
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   835
			} catch (Exception e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   836
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   837
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   838
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   839
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   840
			IBinaryParser parser = CCorePlugin.getDefault().getDefaultBinaryParser();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   841
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   842
			IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   843
			if (exe != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   844
				fileType = exe.getType();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   845
				return fileType == IBinaryParser.IBinaryFile.SHARED;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   846
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   847
		} catch (Exception e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   848
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   849
		return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   850
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   851
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   852
	private static void displayWarningDialog(final String msg) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   853
		//  Display warning dialog
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   854
		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   855
		if(window == null){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   856
			IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   857
			window = windows[0];
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   858
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   859
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   860
		final Shell shell = window.getShell();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   861
		//using syncExec could cause a dead-lock
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   862
		//that is why asyncExec is used
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   863
		shell.getDisplay().asyncExec( new Runnable() {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   864
			public void run() {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   865
				MessageDialog.openWarning(shell, Messages.getString("SettingsData.70"), msg); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   866
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   867
		} );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   868
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   869
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   870
	public static boolean isAppTRKConfiguration(ILaunchConfiguration configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   871
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   872
			ILaunchConfigurationType configurationType = configuration.getType();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   873
			String id = configurationType.getIdentifier();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   874
			return id.equals(APP_TRK_LAUNCH_TYPE_ID);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   875
		} catch (CoreException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   876
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   877
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   878
		return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   879
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   880
	
1171
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   881
	public static boolean isSysTRKConfiguration(ILaunchConfiguration configuration) {
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   882
		try {
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   883
			ILaunchConfigurationType configurationType = configuration.getType();
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   884
			String id = configurationType.getIdentifier();
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   885
			return id.equals(SYS_TRK_LAUNCH_TYPE_ID);
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   886
		} catch (CoreException e) {
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   887
		}
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   888
		
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   889
		return false;
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   890
	}
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 1099
diff changeset
   891
	
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   892
	public static boolean isEmulatorConfiguration(ILaunchConfiguration configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   893
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   894
			ILaunchConfigurationType configurationType = configuration.getType();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   895
			String id = configurationType.getIdentifier();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   896
			return id.equals(EMULATION_LAUNCH_TYPE_ID);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   897
		} catch (CoreException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   898
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   899
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   900
		return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   901
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   902
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   903
	public static void setProcessToLaunch(ILaunchConfigurationWorkingCopy configuration, IPath path) {
684
8e7900690341 Extract path-manipulation utilities into PathUtils, to correspond with the same classes in EDC.
Ed Swartz <ed.swartz@nokia.com>
parents: 664
diff changeset
   904
		configuration.setAttribute(PreferenceConstants.J_PN_RemoteProcessToLaunch, PathUtils.convertPathToWindows(path));
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   905
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   906
	
1513
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   907
	private static void setLaunchConfigurationName(ILaunchConfigurationWorkingCopy config, String proposedName) {
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   908
		String name = proposedName;
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   909
		
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   910
		// the call to generateLaunchConfigurationName below will replace all \'s with _'s
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   911
		// the code below just removes any \ or : at the end of the SDK name, if for example
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   912
		// they gave the SDK a name of "M:" or "M:\".
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   913
		if (name.endsWith("\\]")) { //$NON-NLS-1$
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   914
			name = name.substring(0, name.length() - 2) + "]"; //$NON-NLS-1$
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   915
		}
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   916
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   917
		if (name.endsWith(":]")) { //$NON-NLS-1$
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   918
			name = name.substring(0, name.length() - 2) + "]"; //$NON-NLS-1$
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   919
		}
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   920
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   921
		config.rename(DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(name));
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   922
	}
8a8e855bd44e fixed bug #11211. also fixed issue where apply button was active after creating new launch configs from the launch dialog (rather than the wizard).
wpaul
parents: 1384
diff changeset
   923
}