debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/SettingsData.java
author stechong
Tue, 08 Jun 2010 16:16:02 -0500
branchC3_BUILDER_WORK
changeset 1445 ab286ee6e57a
parent 1384 10b788ab16fe
child 1469 5844e41d8bc7
permissions -rw-r--r--
Fixed more errors due to ISymbianSDK refactoring.
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;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    64
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
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;
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
    70
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
    71
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    72
import cwdbg.PreferenceConstants;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    73
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    74
public class SettingsData {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    75
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    76
	// NOTE: Many of these constants are mirrored in 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    77
	// com.freescale.cdt.debug.cw.core.RemoteConnectionsTRKHelper
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    78
	// 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
    79
	// 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
    80
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    81
	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
    82
	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
    83
	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
    84
	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
    85
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    86
	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
    87
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    88
	// Executable targeting
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    89
	public static final int LCS_ExeTargetingRule_AllInSDK = 0;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    90
	public static final int LCS_ExeTargetingRule_AllInProject = 1;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    91
	public static final int LCS_ExeTargetingRule_ExeList = 2;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    92
	public static final int LCS_ExeTargetingRule_All = 3;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    93
	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
    94
	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
    95
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    96
	// Launch Type IDs
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    97
	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
    98
	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
    99
	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
   100
	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
   101
	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
   102
	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
   103
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   104
	//================ Shadowed CW Preference Panels =================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   105
	// 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
   106
	// 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
   107
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   108
	// 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
   109
	private static String SPN(String cwPanelName, String cwPrefName)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   110
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   111
		return Utils.formShadowedPrefName(cwPanelName, 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
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   114
	//---< Serial Communication Panel> -------------------
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
	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
   117
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   118
	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
   119
	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
   120
	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
   121
	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
   122
	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
   123
	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
   124
	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
   125
	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
   126
	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
   127
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   128
	//================= End of Shadowed panels ===========================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   129
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
   130
	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
   131
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   132
	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
   133
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   134
	private static String[] exceptionPropertyNames = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   135
	private static IPath mainExeTargetPath = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   136
	private static IPath mainExeHostPath = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   137
	private static IPath mainExeWorkspaceRelativeMMPPath = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   138
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   139
	public static String[] getExceptionPropertyNames()
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
		if (exceptionPropertyNames == null)
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
			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
   144
				"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
   145
				"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
   146
				"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
   147
				"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
   148
				"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
   149
				"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
   150
				"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
   151
				"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
   152
				"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
   153
				"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
   154
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   155
		};
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
			exceptionPropertyNames = new String[exceptionPrefNames.length];
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   158
			for (int i = 0; i < exceptionPrefNames.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   159
				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
   160
				exceptionPropertyNames[i] = Utils.formShadowedPrefName(cwPanelName, exceptionPrefNames[i]);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   161
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   162
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   163
		return exceptionPropertyNames;
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
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
	static private void addSymbianSDKMapping(String epocRoot, ILaunchConfigurationWorkingCopy configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   168
		if (epocRoot.length() > 0 && new File(epocRoot).exists())
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   169
			configuration.setAttribute(SymbianPlugin.Epoc_Root, epocRoot);
1099
88ab187cbeb8 Refactor source mapping to com.nokia.cdt.debug.common plugin
timkelly
parents: 822
diff changeset
   170
	}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   171
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   172
	static public void addSymbianSDKMapping(Path executable, ILaunchConfigurationWorkingCopy configuration) {
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
		String epocRoot = "";
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   175
		String[] segs = executable.segments();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   176
		for (int i = 0; i < segs.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   177
			if (segs[i].equalsIgnoreCase("epoc32"))
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   178
				epocRoot = executable.removeLastSegments(segs.length - i).toOSString();				
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   179
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   180
		addSymbianSDKMapping(epocRoot, configuration);
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
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   183
	static public void addSymbianSDKMapping(IProject project, ILaunchConfigurationWorkingCopy configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   184
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   185
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   186
			if (cpi == null){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   187
				try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   188
					String exeLocation = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   189
					Path exePath = new Path(exeLocation);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   190
					addSymbianSDKMapping(exePath, configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   191
				} catch (CoreException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   192
					e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   193
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   194
			}else{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   195
				String epocRoot = cpi.getDefaultConfiguration().getSDK().getEPOCROOT();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   196
				addSymbianSDKMapping(epocRoot, configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   197
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   198
		}
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
	private static IBinary setProgramNameToFirstBinary(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   202
    	List<IBinary> applicableBinaries = getApplicableBinaries(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   203
		IBinary binaryToUse = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   204
		// try to find an exe to use
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   205
		for (IBinary binary : applicableBinaries) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   206
			if (binary.isExecutable()) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   207
				binaryToUse = binary;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   208
				break;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   209
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   210
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   211
		// if none, use the first in the list
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   212
		if (binaryToUse == null && !applicableBinaries.isEmpty())
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   213
			binaryToUse = applicableBinaries.get(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   214
		if (binaryToUse != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   215
			IPath location = binaryToUse.getResource().getLocation();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   216
			configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, location.toOSString());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   217
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   218
		return binaryToUse;
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
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   221
	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
   222
		List<IBinary> applicableBinaries = new ArrayList<IBinary>();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   223
		boolean isEmulatorConfig = isEmulatorConfiguration(configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   224
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   225
			ICProject cProject = CoreModel.getDefault().create(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   226
			if (cProject != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   227
				IBinary[] binaries = cProject.getBinaryContainer().getBinaries();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   228
				for (int i = 0; i < binaries.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   229
					IPath path = getCanonicalPath(binaries[i].getResource().getLocation());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   230
					int numSegs = path.segmentCount();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   231
					if (numSegs >= 3) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   232
						if (isEmulatorConfig == "WINSCW".equalsIgnoreCase(path.segment(numSegs - 3)))
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   233
							applicableBinaries.add(binaries[i]);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   234
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   235
				}
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
		} catch (CModelException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   238
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   239
			displayWarningDialog(Messages.getString("SettingsData.38")); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   240
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   241
		return applicableBinaries;
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
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
	public static void setEmulationMainTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   246
		//======== Emulator: main tab ======================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   247
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   248
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   249
			String projectName = project.getName();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   250
			configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   251
			configuration.setMappedResources( new IResource[] { project });
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   252
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   253
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   254
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   255
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   256
				String configName = projectName + " " + buildConfig.getDisplayString(); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   257
				configuration.rename(DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configName));
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   258
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   259
				// 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
   260
				// is an emulator build, otherwise warn them that we can't set default values.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   261
				if (buildConfig.getPlatformString().compareTo(ISymbianBuildContext.EMULATOR_PLATFORM) == 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   262
					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
   263
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   264
					if (isEmulatorRequired(buildConfig, mainExeHostPath, mainExeWorkspaceRelativeMMPPath)) {
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   265
						ISymbianSDK sdk = buildConfig.getSDK();
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   266
						ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)sdk.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   267
						IPath releaseRoot;
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   268
						if (sbsv1BuildInfo != null) {
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   269
							releaseRoot = sbsv1BuildInfo.getReleaseRoot(sdk);
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   270
						} else {
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   271
							releaseRoot = new Path(sdk.getEPOCROOT()).append("epoc32/release");
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   272
						}
803
cdf530a6195e Bug 10344. Selecting wrong target for WINSCW UREL when launching emulator.
timkelly
parents: 753
diff changeset
   273
						String winscwudeb = releaseRoot.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
   274
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   275
						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
   276
						configuration.setAttribute(DebuggerCommonData.Host_App_Path, getCanonicalPath(emulatorPath));			
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 if (mainExeHostPath != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   279
						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
   280
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   281
				} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   282
					displayWarningDialog(Messages.getString("SettingsData.37")); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   283
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   284
			}
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
				if (mainExeHostPath != null && !mainExeHostPath.isEmpty()) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   287
					configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, mainExeHostPath.toOSString()); 				 					
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
					// launch the emulator for non-"exe" files
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   290
					if ("exe".equalsIgnoreCase(mainExeHostPath.getFileExtension())) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   291
	 					configuration.setAttribute(DebuggerCommonData.Host_App_Path, mainExeHostPath.toOSString());			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   292
					} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   293
	   					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
   294
	 					configuration.setAttribute(DebuggerCommonData.Host_App_Path, getCanonicalPath(emulatorPath));			
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
				} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   297
					IBinary binary = setProgramNameToFirstBinary(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   298
					if (binary.isExecutable()) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   299
						configuration.setAttribute(DebuggerCommonData.Host_App_Path, 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   300
								getCanonicalPath(binary.getResource().getLocation()).toOSString());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   301
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   302
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   303
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   304
		}
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
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   307
	private static String getCanonicalPath(String path) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   308
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   309
			return new File(path).getCanonicalPath();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   310
		} catch (IOException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   311
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   312
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   313
		return path;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   314
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   315
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   316
	private static IPath getCanonicalPath(IPath path) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   317
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   318
			if (path == null)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   319
				return null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   320
			return new Path(path.toFile().getCanonicalPath());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   321
		} catch (IOException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   322
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   323
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   324
		return path;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   325
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   326
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   327
	public static void setEmulationDebuggerTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   328
		//============= Emulator debugger tab ============================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   329
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   330
		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
   331
		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
   332
		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
   333
		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
   334
		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
   335
		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
   336
		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
   337
		configuration.setAttribute( PreferenceConstants.J_PN_ViewProcessOutput, true);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   338
		configuration.setAttribute( PreferenceConstants.J_PN_ViewSystemMessage, false);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   339
		configuration.setAttribute( SymbianPlugin.DebugTraceLaunchSetting, true);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   340
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   341
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   342
	public static void setX86ExceptionsTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   343
		//======= Emulator: x86 Exceptions tab ===================================
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
		String[] exceptionPropertyNames = getExceptionPropertyNames();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   346
		// 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
   347
		// a bunch of recoverable exceptions while starting up
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   348
		for (int i = 0; i < exceptionPropertyNames.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   349
			configuration.setAttribute(exceptionPropertyNames[i], false);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   350
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   351
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   352
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   353
	public static void setTrkMainTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   354
		//===== TRK :  main tab =================================================== 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   355
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   356
		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
   357
		configuration.setAttribute(PreferenceConstants.J_PN_ProgramArguments, ""); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   358
1208
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   359
	    HashSet<String> set = new HashSet<String>();
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   360
	    set.add(ILaunchManager.DEBUG_MODE);
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   361
	    try {
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   362
    	    ILaunchDelegate preferredDelegate = configuration.getPreferredDelegate(set);
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   363
    	    if (preferredDelegate == null) {
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   364
    	        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
   365
    	        	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
   366
    	        } 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
   367
    	        	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
   368
    	        } 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
   369
    	        	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
   370
                } 
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   371
    	    }
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   372
	    } catch (CoreException e) {}
54c7e69fdb2c Make EDC the default launcher for TRK launch configuration types.
Ken Ryall
parents: 1171
diff changeset
   373
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   374
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   375
			String projectName = project.getName();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   376
			configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   377
			configuration.setMappedResources( new IResource[] { project });
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
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   380
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   381
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   382
				String configName = projectName + " " + buildConfig.getDisplayString(); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   383
				configuration.rename(DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configName));
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   384
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   385
				// 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
   386
				// otherwise warn them that we can't set default values.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   387
				if (buildConfig.getPlatformString().compareTo(ISymbianBuildContext.EMULATOR_PLATFORM) != 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   388
					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
   389
					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
   390
				} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   391
					displayWarningDialog(Messages.getString("SettingsData.37")); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   392
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   393
			} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   394
				IBinary binary = setProgramNameToFirstBinary(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   395
				String exeName = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   396
				if (mainExeHostPath != null)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   397
					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
   398
				else if (binary != null && binary.isExecutable())
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   399
					exeName = binary.getResource().getLocation().lastSegment();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   400
				if (exeName != null)	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   401
					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
   402
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   403
		}	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   404
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   405
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   406
	public static void setStopModeMainTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   407
		//===== StopMode :  main tab =================================================== 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   408
		//		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   409
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   410
			String projectName = project.getName();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   411
			configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   412
			configuration.setMappedResources( new IResource[] { project });
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
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   415
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   416
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   417
				String configName = projectName + " " + buildConfig.getDisplayString(); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   418
				configuration.rename(DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configName));
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   419
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   420
				// 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
   421
				// otherwise warn them that we can't set default values.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   422
				if (buildConfig.getPlatformString().compareTo(ISymbianBuildContext.EMULATOR_PLATFORM) != 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   423
					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
   424
				} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   425
					displayWarningDialog(Messages.getString("SettingsData.37")); //$NON-NLS-1$
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
			} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   428
				setProgramNameToFirstBinary(configuration, project);
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
		}	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   431
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   432
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   433
	public static void setTrkDebuggerTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   434
		//======  TRK:  debugger tab ================================================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   435
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   436
		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
   437
		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
   438
		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
   439
		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
   440
		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
   441
		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
   442
		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
   443
		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
   444
		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
   445
		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
   446
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   447
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   448
	public static void setStopModeDebuggerTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   449
		//======  Stop Mode:  debugger tab ================================================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   450
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   451
		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
   452
		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
   453
		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
   454
		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
   455
		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
   456
		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
   457
		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
   458
		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
   459
		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
   460
		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
   461
		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
   462
		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
   463
		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
   464
		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
   465
		configuration.setAttribute( PreferenceConstants.J_PN_ResetTarget, false);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   466
	}
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
   467
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   468
	public static void setSerialConnTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   469
		//======== Serial Connection Tab =====================================
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
		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
   472
		configuration.setAttribute(RemoteConnectionsTRKHelper.USES_REMOTE_CONNECTIONS_ATTRIBUTE, true);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   473
		IConnection defaultConnection = RemoteConnectionsTRKHelper.getFirstCompatibleConnection();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   474
		if (defaultConnection != null)
753
bde477f39c26 fix bug with storing id for default connection
dadubrow
parents: 684
diff changeset
   475
			RemoteConnectionsTRKHelper.setRemoteConnectionAttribute(configuration, defaultConnection);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   476
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   477
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   478
	public static void setFileTransferTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   479
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   480
		//======== File Transfer tab ============================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   481
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   482
		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
   483
		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
   484
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   485
		// 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
   486
		if (project != null) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   487
			
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   488
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   489
			if (cpi != null) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   490
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   491
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   492
				String defaultTargetPath = "C:\\"; //$NON-NLS-1$
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   493
				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
   494
					// C:\\sys\bin for eka2
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   495
					defaultTargetPath += "sys\\bin\\"; //$NON-NLS-1$
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
				String prefsData = "";
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   498
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   499
				// 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
   500
				// that are actually being built.
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   501
				List<IPath> builtComponents = EpocEngineHelper.getComponentsBuiltByConifguration(buildConfig);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   502
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   503
				// 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
   504
				for (IPath mmp : EpocEngineHelper.getMMPFilesForBuildConfiguration(buildConfig)) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   505
					String enabled = builtComponents.contains(mmp) ? ",1," : ",0,";
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   506
					IPath hp = EpocEngineHelper.getHostPathForExecutable(buildConfig, mmp);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   507
					if (hp != null) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   508
						IPath tp = EpocEngineHelper.getTargetPathForExecutable(buildConfig, mmp);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   509
						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
   510
							tp = PathUtils.createPath(defaultTargetPath).append(hp.lastSegment());
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   511
						}
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
   512
						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
   513
					}
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   514
					
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   515
					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
   516
					// Add resource files...
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   517
					for (String currHostRSRC : hostTargetRSRCMap.keySet()) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   518
						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
   519
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   520
				}
200
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
				// check the project for image makefiles
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   523
				HashMap<String, String> hostTargetImagesMap = EpocEngineHelper.getHostAndTargetImages(buildConfig);
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   524
				for (String currHostImg : hostTargetImagesMap.keySet()) {
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   525
					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
   526
				}
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   527
				
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   528
				// 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
   529
				configuration.setAttribute( PreferenceConstants.J_PN_FilesToTransfer, prefsData );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   530
			}
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
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   533
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   534
	public static void setInstallationTab(ILaunchConfigurationWorkingCopy configuration, IProject project) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   535
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   536
		//=========== AppTRK Installation tab ==========================================
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
		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
   539
		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
   540
		configuration.setAttribute( PreferenceConstants.J_PN_AlwaysInstallSisFile, false );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   541
		configuration.setAttribute( PreferenceConstants.J_PN_HideInstallerUI, true );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   542
		configuration.setAttribute( PreferenceConstants.J_PN_InstallToDrive, 2 ); // C:
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   543
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   544
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   545
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   546
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   547
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   548
				List<ISISBuilderInfo> sisInfoList = cpi.getDefaultConfiguration().getSISBuilderInfoList();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   549
				if (sisInfoList != null && sisInfoList.size() > 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   550
					// 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
   551
					// in later built ones
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   552
					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
   553
				}
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
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   556
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   557
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   558
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   559
	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
   560
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   561
		//======== Executables Tab =====================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   562
		// Defaults to all executables from the same SDK
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   563
		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
   564
		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
   565
		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
   566
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   567
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
	 * 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
   570
	 * 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
   571
	 * 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
   572
	 *      
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   573
	 * 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
   574
	 * 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   575
	 * Any internal preferences should be set here.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   576
	 * 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   577
	 */ 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   578
	public static void setInternalPreferences(ILaunchConfigurationWorkingCopy configuration, String settingsGroup)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   579
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   580
		// 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
   581
		// 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   582
		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
   583
			configuration.setAttribute( PreferenceConstants.J_PN_SupportOSView, false );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   584
		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
   585
			configuration.setAttribute( PreferenceConstants.J_PN_SupportOSView, true );
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
		if (settingsGroup.equals(LaunchConfig_AppTRK) || 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   588
			    settingsGroup.equals(LaunchConfig_SysTRK) ||
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   589
			    settingsGroup.equals(LaunchConfig_Emulator))
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   590
		{
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
   591
			configuration.setAttribute( PreferenceConstants.J_PN_IsSystemModeDebug, false );
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   592
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   593
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   594
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   595
	// a convenience function.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   596
	public static void setInternalPreferences(ILaunchConfiguration originalConfig, String settingsGroup)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   597
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   598
		ILaunchConfigurationWorkingCopy wc = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   599
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   600
			wc = originalConfig.getWorkingCopy();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   601
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   602
			if (wc == null)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   603
				return;
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
			setInternalPreferences(wc, settingsGroup);
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
			wc.doSave();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   608
		} catch (CoreException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   609
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   610
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   611
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   612
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   613
	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
   614
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   615
		if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   616
	        ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   617
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   618
				ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   619
				// 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
   620
				List<IPath> exePaths = new ArrayList<IPath>(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   621
				List<IPath> mmpPaths = new ArrayList<IPath>(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   622
				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
   623
				if (exePaths.size() > 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   624
					// 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
   625
					IPath exePath = exePaths.get(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   626
					IPath mmpPath = mmpPaths.get(0);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   627
					for (int i=0; i<exePaths.size(); i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   628
						String fileExt = exePaths.get(i).getFileExtension();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   629
						if (fileExt != null && fileExt.compareToIgnoreCase("exe") == 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   630
							exePath = exePaths.get(i);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   631
							mmpPath = mmpPaths.get(i);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   632
							break;
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, mmpPath, exePath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   637
					return;
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
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   641
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   642
		setDefaults(configuration, settingsGroup, project, null, null);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   643
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   644
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   645
	/**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   646
	 * Sets the default values for the launch configuration.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   647
	 * @param configuration
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   648
	 * @param settingsGroup
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   649
	 * @param project
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   650
	 * @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
   651
	 * @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
   652
	 */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   653
	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
   654
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   655
		// 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
   656
		// 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
   657
		mainExeHostPath = getCanonicalPath(mainExePath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   658
		mainExeTargetPath = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   659
		mainExeWorkspaceRelativeMMPPath = workspaceRelativeMMPPath;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   660
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   661
		if (workspaceRelativeMMPPath != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   662
			if (project != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   663
				ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   664
				if (cpi != null) {			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   665
					ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   666
664
18b0c24adafe Fix more path conversion issues with Symbian launch
Ed Swartz <ed.swartz@nokia.com>
parents: 419
diff changeset
   667
					// do not canonicalize
18b0c24adafe Fix more path conversion issues with Symbian launch
Ed Swartz <ed.swartz@nokia.com>
parents: 419
diff changeset
   668
					mainExeTargetPath = EpocEngineHelper.getTargetPathForExecutable(buildConfig, workspaceRelativeMMPPath);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   669
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   670
			}
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
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   673
		// 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
   674
		// 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
   675
		// 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
   676
		// 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
   677
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   678
		// ==== common to all =======================================================================
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   679
		//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   680
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   681
		// Specify which debugger plugin to use.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   682
		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
   683
		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
   684
		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   685
		if (project != null)
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
			configuration.setMappedResources( new IResource[] { project });
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   688
		    ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   689
			if (cpi != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   690
				configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, cpi.getDefaultBuildConfigName());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   691
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   692
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   693
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   694
		
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
   695
		// 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
   696
		// 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
   697
		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
   698
		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
   699
		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
   700
		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
   701
1382
4ddf9fb521b2 removed old crash debugger.
wpaul
parents: 1208
diff changeset
   702
		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, SymbianDebugger.DEBUGGER_ID);
4ddf9fb521b2 removed old crash debugger.
wpaul
parents: 1208
diff changeset
   703
4ddf9fb521b2 removed old crash debugger.
wpaul
parents: 1208
diff changeset
   704
		setExecutablesTab(configuration, settingsGroup, project);
0
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
		setInternalPreferences(configuration, settingsGroup);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   707
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   708
		if (settingsGroup.equals(LaunchConfig_Emulator)) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   709
			setEmulationMainTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   710
			setEmulationDebuggerTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   711
			setX86ExceptionsTab(configuration, project);			
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
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   714
		if (settingsGroup.equals(LaunchConfig_AppTRK) || 
1382
4ddf9fb521b2 removed old crash debugger.
wpaul
parents: 1208
diff changeset
   715
			    settingsGroup.equals(LaunchConfig_SysTRK))
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   716
		{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   717
			setSerialConnTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   718
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   719
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   720
		if (settingsGroup.equals(LaunchConfig_AppTRK)) {
200
08d645f6399f removed unnecesssary context launch code. cleaned up for easier platsim integration.
wpaul
parents: 0
diff changeset
   721
			setInstallationTab(configuration, project);
243
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   722
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   723
			// 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
   724
			// 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
   725
			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
   726
			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
   727
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   728
		
243
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   729
		if (settingsGroup.equals(LaunchConfig_SysTRK)) {
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   730
			setFileTransferTab(configuration, project);
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   731
		}
83c1dc10c047 fixed problem with my last commit - fixes bug #9276.
wpaul
parents: 229
diff changeset
   732
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   733
		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
   734
			setTrkMainTab(configuration, project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   735
			setTrkDebuggerTab(configuration, project);
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
			// TRK Debugging: specify TRK protocol plugin.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   738
			//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   739
			ConnectionTypeInfo connTI = new ConnectionTypeInfo(
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   740
					"Carbide TRK", // Internal ID //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   741
					"Symbian MetroTRK", // Display name //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   742
					spn_SerialComm); // Pref panel name
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
			DebuggerCommonData.setLaunchConfigConnSettings(
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   745
					configuration,
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   746
					connTI, 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   747
					"Symbian MetroTRK Protocol", //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   748
					""); // Protocol plugin name //$NON-NLS-1$
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
		// Add the Symbian OS SDK Mapping.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   752
		addSymbianSDKMapping(project, configuration);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   753
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   754
		configuration.setAttribute(ATTR_originalName, configuration.getName());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   755
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   756
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   757
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
	 * 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
   760
	 * 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
   761
	 * 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
   762
	 * (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
   763
	 * @param buildConfig - current build config
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   764
	 * @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
   765
	 */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   766
	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
   767
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   768
        ICarbideProjectInfo cpi = buildConfig.getCarbideProject();
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
		if (cpi != null && mainExeHostPath != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   771
			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
   772
				Version version = cpi.getDefaultConfiguration().getSDK().getOSVersion();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   773
				if (!(version.getMajor() == 9 && version.getMinor() == 1)) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   774
					return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   775
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   776
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   777
				// 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
   778
				// 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
   779
				// 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
   780
				if (mainExeWorkspaceRelativeMMPPath != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   781
					String uid2 = EpocEngineHelper.getUID2(buildConfig, mainExeWorkspaceRelativeMMPPath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   782
					if (uid2 != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   783
						if (uid2.compareToIgnoreCase("0x100039CE") != 0) { //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   784
							return false;
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
					}
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
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   789
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   790
		return true;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   791
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   792
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   793
	public static boolean isEmulatorRequired(IPath mainExeHostPath)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   794
	{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   795
		List<ISymbianSDK> sdkList = new ArrayList<ISymbianSDK>();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   796
		sdkList = SDKCorePlugin.getSDKManager().getSDKList();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   797
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   798
		for (ISymbianSDK currSDK : sdkList){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   799
			if (new Path(currSDK.getEPOCROOT()).isPrefixOf(mainExeHostPath))
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   800
			{
1445
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   801
			    // Apparently this only works correctly with the S60 emulator.
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   802
				ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   803
				if (sbsv1BuildInfo != null) {
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   804
			        if (!sbsv1BuildInfo.isS60(currSDK) &&
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   805
			        	!sbsv1BuildInfo.getFamily(currSDK).equalsIgnoreCase(ISBSv1BuildInfo.TECHVIEW_FAMILY_ID))
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   806
			        	return true;
ab286ee6e57a Fixed more errors due to ISymbianSDK refactoring.
stechong
parents: 1384
diff changeset
   807
				}
0
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
				if ("exe".equalsIgnoreCase(mainExeHostPath.getFileExtension())) { //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   810
					Version version = currSDK.getOSVersion();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   811
					if (!(version.getMajor() == 9 && version.getMinor() == 1)) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   812
						return false;
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
				
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
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   818
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   819
		return true;
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
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   822
	// 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
   823
	//
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   824
	static public boolean isSharedLib(IProject project, IPath exePath) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   825
		int fileType;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   826
		ICExtensionReference[] parserRef;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   827
		
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
			parserRef = CCorePlugin.getDefault().getBinaryParserExtensions(project);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   830
		} catch (Exception e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   831
			return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   832
		};
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   833
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   834
		for (int i = 0; i < parserRef.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   835
			try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   836
				IBinaryParser parser = (IBinaryParser)parserRef[i].createExtension();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   837
				IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   838
				if (exe != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   839
					fileType = exe.getType();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   840
					return fileType == IBinaryParser.IBinaryFile.SHARED;
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
			} catch (Exception e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   843
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   844
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   845
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   846
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   847
			IBinaryParser parser = CCorePlugin.getDefault().getDefaultBinaryParser();
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
			IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   850
			if (exe != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   851
				fileType = exe.getType();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   852
				return fileType == IBinaryParser.IBinaryFile.SHARED;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   853
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   854
		} catch (Exception e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   855
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   856
		return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   857
	}
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
	private static void displayWarningDialog(final String msg) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   860
		//  Display warning dialog
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   861
		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   862
		if(window == null){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   863
			IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   864
			window = windows[0];
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   865
		}
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
		final Shell shell = window.getShell();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   868
		//using syncExec could cause a dead-lock
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   869
		//that is why asyncExec is used
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   870
		shell.getDisplay().asyncExec( new Runnable() {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   871
			public void run() {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   872
				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
   873
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   874
		} );
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   875
	}
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
	public static boolean isAppTRKConfiguration(ILaunchConfiguration configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   878
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   879
			ILaunchConfigurationType configurationType = configuration.getType();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   880
			String id = configurationType.getIdentifier();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   881
			return id.equals(APP_TRK_LAUNCH_TYPE_ID);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   882
		} catch (CoreException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   883
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   884
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   885
		return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   886
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   887
	
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
   888
	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
   889
		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
   890
			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
   891
			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
   892
			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
   893
		} 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
   894
		}
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
   895
		
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
   896
		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
   897
	}
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
   898
	
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   899
	public static boolean isEmulatorConfiguration(ILaunchConfiguration configuration) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   900
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   901
			ILaunchConfigurationType configurationType = configuration.getType();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   902
			String id = configurationType.getIdentifier();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   903
			return id.equals(EMULATION_LAUNCH_TYPE_ID);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   904
		} catch (CoreException e) {
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
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   907
		return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   908
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   909
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   910
	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
   911
		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
   912
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   913
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   914
}