55 import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; |
55 import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; |
56 import com.nokia.carbide.cdt.builder.EpocEngineHelper; |
56 import com.nokia.carbide.cdt.builder.EpocEngineHelper; |
57 import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; |
57 import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; |
58 import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo; |
58 import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo; |
59 import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo; |
59 import com.nokia.carbide.cdt.builder.project.ISISBuilderInfo; |
|
60 import com.nokia.carbide.cpp.internal.support.SupportPlugin; |
60 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; |
61 import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; |
61 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
62 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
62 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; |
63 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; |
63 import com.nokia.carbide.remoteconnections.interfaces.IConnection; |
64 import com.nokia.carbide.remoteconnections.interfaces.IConnection; |
64 |
65 |
140 public static final String spn_SophiaSTIConn_LogOption= SPN(spn_SophiaSTIConn, "STILogOption"); //$NON-NLS-1 |
141 public static final String spn_SophiaSTIConn_LogOption= SPN(spn_SophiaSTIConn, "STILogOption"); //$NON-NLS-1 |
141 public static final String spn_SophiaSTIConn_JtagClock= SPN(spn_SophiaSTIConn, "STIJTAGClock"); //$NON-NLS-1 |
142 public static final String spn_SophiaSTIConn_JtagClock= SPN(spn_SophiaSTIConn, "STIJTAGClock"); //$NON-NLS-1 |
142 public static final String spn_SophiaSTIConn_StiEmulatorType= SPN(spn_SophiaSTIConn, "STIJTAGType"); //$NON-NLS-1 |
143 public static final String spn_SophiaSTIConn_StiEmulatorType= SPN(spn_SophiaSTIConn, "STIJTAGType"); //$NON-NLS-1 |
143 |
144 |
144 //================= End of Shadowed panels =========================================== |
145 //================= End of Shadowed panels =========================================== |
|
146 |
|
147 public static final String TARGET_PATH_INCLUDES_FILENAME = "TARGET_PATH_INCLUDES_FILENAME"; //$NON-NLS-1$ |
145 |
148 |
146 public static final int J_PN_TrkTimeout_Default = 2000; |
149 public static final int J_PN_TrkTimeout_Default = 2000; |
147 |
150 |
148 private static String[] exceptionPropertyNames = null; |
151 private static String[] exceptionPropertyNames = null; |
149 private static IPath mainExeTargetPath = null; |
152 private static IPath mainExeTargetPath = null; |
445 //====== TRK: debugger tab ================================================================ |
455 //====== TRK: debugger tab ================================================================ |
446 // |
456 // |
447 configuration.setAttribute( DebugPlugin.ATTR_PROCESS_FACTORY_ID, ProcessFactory.ID ); |
457 configuration.setAttribute( DebugPlugin.ATTR_PROCESS_FACTORY_ID, ProcessFactory.ID ); |
448 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); |
458 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); |
449 configuration.setAttribute( PreferenceConstants.J_PN_StopAtMainSymbol, "E32Main" ); //$NON-NLS-1$ |
459 configuration.setAttribute( PreferenceConstants.J_PN_StopAtMainSymbol, "E32Main" ); //$NON-NLS-1$ |
450 configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); |
460 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false ); |
451 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false ); |
461 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false ); |
452 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false ); |
462 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false ); |
453 configuration.setAttribute( PreferenceConstants.J_PN_ViewUnframedData, true); |
463 configuration.setAttribute( PreferenceConstants.J_PN_ViewUnframedData, true ); |
454 configuration.setAttribute( PreferenceConstants.J_PN_ViewCommMessages, false); |
464 configuration.setAttribute( PreferenceConstants.J_PN_ViewCommMessages, false ); |
455 configuration.setAttribute( PreferenceConstants.J_PN_DefaultInstructionSet, PreferenceConstants.J_PV_DefaultInstructionSet_Auto); |
465 configuration.setAttribute( PreferenceConstants.J_PN_DefaultInstructionSet, PreferenceConstants.J_PV_DefaultInstructionSet_Auto ); |
456 configuration.setAttribute( PreferenceConstants.J_PN_TRKMessageTimeout, J_PN_TrkTimeout_Default); |
466 configuration.setAttribute( PreferenceConstants.J_PN_TRKMessageTimeout, J_PN_TrkTimeout_Default ); |
457 } |
467 } |
458 |
468 |
459 public static void setStopModeDebuggerTab(ILaunchConfigurationWorkingCopy configuration, IProject project) { |
469 public static void setStopModeDebuggerTab(ILaunchConfigurationWorkingCopy configuration, IProject project) { |
460 //====== Stop Mode: debugger tab ================================================================ |
470 //====== Stop Mode: debugger tab ================================================================ |
461 // |
471 // |
462 configuration.setAttribute( DebugPlugin.ATTR_PROCESS_FACTORY_ID, ProcessFactory.ID ); |
472 configuration.setAttribute( DebugPlugin.ATTR_PROCESS_FACTORY_ID, ProcessFactory.ID ); |
463 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); |
473 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); |
464 configuration.setAttribute( PreferenceConstants.J_PN_StopAtMainSymbol, "E32Main" ); //$NON-NLS-1$ |
474 configuration.setAttribute( PreferenceConstants.J_PN_StopAtMainSymbol, "E32Main" ); //$NON-NLS-1$ |
465 configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false); |
475 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false ); |
466 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false ); |
476 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_VARIABLE_BOOKKEEPING, false ); |
467 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false ); |
477 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ENABLE_REGISTER_BOOKKEEPING, false ); |
468 configuration.setAttribute( PreferenceConstants.J_PN_DefaultInstructionSet, PreferenceConstants.J_PV_DefaultInstructionSet_Auto); |
478 configuration.setAttribute( PreferenceConstants.J_PN_RomImgStartAddress , 0); |
469 } |
479 configuration.setAttribute( PreferenceConstants.J_PN_DebugRunFromStart, PreferenceConstants.J_PV_DebugRunFromStart_Debug); |
|
480 configuration.setAttribute( PreferenceConstants.J_PN_DefaultInstructionSet, PreferenceConstants.J_PV_DefaultInstructionSet_Auto ); |
|
481 configuration.setAttribute( PreferenceConstants.J_PN_TargetProcessor, 8); |
|
482 configuration.setAttribute( PreferenceConstants.J_PN_RunTargetInitFile, false); |
|
483 configuration.setAttribute( PreferenceConstants.J_PN_TargetInitFilePath, ""); //$NON-NLS-1$ |
|
484 configuration.setAttribute( PreferenceConstants.J_PN_RunMemConfigFile, false); |
|
485 configuration.setAttribute( PreferenceConstants.J_PN_MemConfigFilePath, ""); //$NON-NLS-1$ |
|
486 configuration.setAttribute( PreferenceConstants.J_PN_ResetTarget, false); |
|
487 } |
|
488 |
470 public static void setSerialConnTab(ILaunchConfigurationWorkingCopy configuration, IProject project) { |
489 public static void setSerialConnTab(ILaunchConfigurationWorkingCopy configuration, IProject project) { |
471 //======== Serial Connection Tab ===================================== |
490 //======== Serial Connection Tab ===================================== |
472 // |
491 // |
473 configuration.setAttribute(PreferenceConstants.J_PN_TrkConnectionType, PreferenceConstants.J_PV_TrkConnectionType_Serial); |
492 configuration.setAttribute(PreferenceConstants.J_PN_TrkConnectionType, PreferenceConstants.J_PV_TrkConnectionType_Serial); |
474 configuration.setAttribute(RemoteConnectionsTRKHelper.USES_REMOTE_CONNECTIONS_ATTRIBUTE, true); |
493 configuration.setAttribute(RemoteConnectionsTRKHelper.USES_REMOTE_CONNECTIONS_ATTRIBUTE, true); |
561 |
581 |
562 //======== Executables Tab ===================================== |
582 //======== Executables Tab ===================================== |
563 // Defaults to all executables from the same SDK |
583 // Defaults to all executables from the same SDK |
564 configuration.setAttribute( LCS_ExecutableTargetingRule, LCS_ExeTargetingRule_AllInSDK ); //$NON-NLS-1$ |
584 configuration.setAttribute( LCS_ExecutableTargetingRule, LCS_ExeTargetingRule_AllInSDK ); //$NON-NLS-1$ |
565 configuration.setAttribute( PreferenceConstants.J_PN_ExecutablesToDebug, "" ); //$NON-NLS-1$ |
585 configuration.setAttribute( PreferenceConstants.J_PN_ExecutablesToDebug, "" ); //$NON-NLS-1$ |
566 configuration.setAttribute( PreferenceConstants.J_PN_SymbolLoadingRule, PreferenceConstants.J_PV_SymbolLoadingRule_Auto); |
586 configuration.setAttribute( PreferenceConstants.J_PN_SymbolLoadingRule, PreferenceConstants.J_PV_SymbolLoadingRule_Auto ); |
567 } |
587 } |
568 |
588 |
569 /** |
589 /** |
570 * There are "internal preferences" that are not visible to (hence not changeable by) users. |
590 * There are "internal preferences" that are not visible to (hence not changeable by) users. |
571 * We set the values for them for different launch configurations. But when we change any |
591 * We set the values for them for different launch configurations. But when we change any |
579 public static void setInternalPreferences(ILaunchConfigurationWorkingCopy configuration, String settingsGroup) |
599 public static void setInternalPreferences(ILaunchConfigurationWorkingCopy configuration, String settingsGroup) |
580 { |
600 { |
581 // All but emulator debugger support OS Data View (kernel aware view) at present. |
601 // All but emulator debugger support OS Data View (kernel aware view) at present. |
582 // |
602 // |
583 if (settingsGroup.equals(LaunchConfig_Emulator)) |
603 if (settingsGroup.equals(LaunchConfig_Emulator)) |
584 configuration.setAttribute( PreferenceConstants.J_PN_SupportOSView, false); |
604 configuration.setAttribute( PreferenceConstants.J_PN_SupportOSView, false ); |
585 else |
605 else |
586 configuration.setAttribute( PreferenceConstants.J_PN_SupportOSView, true); |
606 configuration.setAttribute( PreferenceConstants.J_PN_SupportOSView, true ); |
587 |
607 |
588 if (settingsGroup.equals(LaunchConfig_AppTRK) || |
608 if (settingsGroup.equals(LaunchConfig_AppTRK) || |
589 settingsGroup.equals(LaunchConfig_SysTRK) || |
609 settingsGroup.equals(LaunchConfig_SysTRK) || |
590 settingsGroup.equals(LaunchConfig_Emulator)) |
610 settingsGroup.equals(LaunchConfig_Emulator)) |
591 { |
611 { |
592 configuration.setAttribute( PreferenceConstants.J_PN_IsSystemModeDebug, false); |
612 configuration.setAttribute( PreferenceConstants.J_PN_IsSystemModeDebug, false ); |
593 } |
613 } |
594 else // others like T32, Sophia and crash debugger. |
614 else // others like T32, Sophia and crash debugger. |
595 configuration.setAttribute( PreferenceConstants.J_PN_IsSystemModeDebug, true); |
615 configuration.setAttribute( PreferenceConstants.J_PN_IsSystemModeDebug, true ); |
596 } |
616 } |
597 |
617 |
598 // a convenience function. |
618 // a convenience function. |
599 public static void setInternalPreferences(ILaunchConfiguration originalConfig, String settingsGroup) |
619 public static void setInternalPreferences(ILaunchConfiguration originalConfig, String settingsGroup) |
600 { |
620 { |
692 configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, cpi.getDefaultBuildConfigName()); |
712 configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, cpi.getDefaultBuildConfigName()); |
693 } |
713 } |
694 |
714 |
695 } |
715 } |
696 |
716 |
|
717 // set rom log file defaults. do this for all launch types since it shouldn't hurt |
|
718 // and could be easy to miss some launch types that use this tab |
|
719 configuration.setAttribute(PreferenceConstants.J_PN_ParseRomLogFile, false); |
|
720 configuration.setAttribute(PreferenceConstants.J_PN_RomLogFilePath, ""); //$NON-NLS-1$ |
|
721 configuration.setAttribute(PreferenceConstants.J_PN_SymbianKitEpoc32Dir, ""); //$NON-NLS-1$ |
|
722 configuration.setAttribute(PreferenceConstants.J_PN_LogUnresolved, false); |
|
723 |
697 // For all but crash debugger, use our "SymbianDebugger". |
724 // For all but crash debugger, use our "SymbianDebugger". |
698 // Crash debugger will set its own debugger (see CrashDebugConfigurationTabGroup.setDefaults()). |
725 // Crash debugger will set its own debugger (see CrashDebugConfigurationTabGroup.setDefaults()). |
699 // |
726 // |
700 if (! settingsGroup.equals(LaunchConfig_CrashDebugger)) { |
727 if (!settingsGroup.equals(LaunchConfig_CrashDebugger)) { |
701 configuration.setAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, SymbianDebugger.DEBUGGER_ID); |
728 configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_ID, SymbianDebugger.DEBUGGER_ID); |
702 // Executables tab is not shown for crash debugger launch configuration. |
729 // Executables tab is not shown for crash debugger launch configuration. |
703 setExecutablesTab(configuration, settingsGroup, project); |
730 setExecutablesTab(configuration, settingsGroup, project); |
704 } |
731 } |
705 |
732 |
706 setInternalPreferences(configuration, settingsGroup); |
733 setInternalPreferences(configuration, settingsGroup); |
721 if (settingsGroup.equals(LaunchConfig_AppTRK)) { |
748 if (settingsGroup.equals(LaunchConfig_AppTRK)) { |
722 setInstallationTab(configuration, project); |
749 setInstallationTab(configuration, project); |
723 |
750 |
724 // set this so it's there in the config and the apply button doesn't become |
751 // set this so it's there in the config and the apply button doesn't become |
725 // enabled when switching to the tab |
752 // enabled when switching to the tab |
726 configuration.setAttribute( PreferenceConstants.J_PN_FilesToTransfer, "" ); //$NON-NLS-1$ |
753 configuration.setAttribute(PreferenceConstants.J_PN_FilesToTransfer, ""); //$NON-NLS-1$ |
|
754 configuration.setAttribute(TARGET_PATH_INCLUDES_FILENAME, "true"); //$NON-NLS-1$ |
727 } |
755 } |
728 |
756 |
729 if (settingsGroup.equals(LaunchConfig_SysTRK)) { |
757 if (settingsGroup.equals(LaunchConfig_SysTRK)) { |
730 setFileTransferTab(configuration, project); |
758 setFileTransferTab(configuration, project); |
731 } |
759 } |
773 connTI, |
801 connTI, |
774 "SymbianCrashDebuggerProtocol", //$NON-NLS-1$ |
802 "SymbianCrashDebuggerProtocol", //$NON-NLS-1$ |
775 ""); // see SymbianCrashDebuggerPrefix.h on DE side //$NON-NLS-1$ |
803 ""); // see SymbianCrashDebuggerPrefix.h on DE side //$NON-NLS-1$ |
776 } |
804 } |
777 |
805 |
778 if (settingsGroup.equals(LaunchConfig_Trace32))//$NON-NLS-1$ |
806 if (settingsGroup.equals(LaunchConfig_Trace32)) { |
779 { |
807 String t32ExePathStr = "C:\\t32\\t32marm.exe"; //$NON-NLS-1$ |
|
808 |
|
809 //set the default config file from the Symbian support folder which has the predefined settings for connecting to Carbide. |
|
810 String supportDir = SupportPlugin.getDefault().getSymbianSupportDirectory(); |
|
811 String defaultConfigFilePath = supportDir + "\\Trace32\\config_carbide.t32"; //$NON-NLS-1$ |
|
812 |
|
813 if (new File("C:\\apps\\t32\\t32marm.exe").exists()) { //$NON-NLS-1$ |
|
814 t32ExePathStr = "C:\\apps\\t32\\t32marm.exe"; //$NON-NLS-1$ |
|
815 // use config_carbide_1.t32 where the SYS path is C:\Apps\T32\ |
|
816 defaultConfigFilePath = supportDir + "\\Trace32\\config_carbide_1.t32"; //$NON-NLS-1$ |
|
817 } |
|
818 |
|
819 configuration.setAttribute(spn_Trace32Conn_ExePath, t32ExePathStr); |
|
820 configuration.setAttribute(spn_Trace32Conn_ConfigFilePath, defaultConfigFilePath); |
|
821 configuration.setAttribute(spn_Trace32Conn_BootScriptFile, ""); //$NON-NLS-1$ |
|
822 configuration.setAttribute(spn_Trace32Conn_LogOption, false); |
|
823 configuration.setAttribute(spn_Trace32Conn_UdpPort, "20000"); //$NON-NLS-1$ |
|
824 configuration.setAttribute(spn_Trace32Conn_BootConfigArgs, ""); //$NON-NLS-1$ |
|
825 |
780 // Stop mode debugging using Trace32 : specify Trace32 debugger protocol plugin. |
826 // Stop mode debugging using Trace32 : specify Trace32 debugger protocol plugin. |
781 // |
827 // |
782 ConnectionTypeInfo connTI = new ConnectionTypeInfo( |
828 ConnectionTypeInfo connTI = new ConnectionTypeInfo( |
783 "Carbide Trace32", // Internal ID //$NON-NLS-1$ |
829 "Carbide Trace32", // Internal ID //$NON-NLS-1$ |
784 "Trace32 Configuration", // Display name. //$NON-NLS-1$ |
830 "Trace32 Configuration", // Display name. //$NON-NLS-1$ |
790 "LAUTERBACH TRACE32 Plugin", //$NON-NLS-1$ |
836 "LAUTERBACH TRACE32 Plugin", //$NON-NLS-1$ |
791 ""); //$NON-NLS-1$ |
837 ""); //$NON-NLS-1$ |
792 } |
838 } |
793 |
839 |
794 if (settingsGroup.equals(LaunchConfig_SophiaSTI)) { |
840 if (settingsGroup.equals(LaunchConfig_SophiaSTI)) { |
|
841 configuration.setAttribute( SettingsData.spn_SophiaSTIConn_DllPath, "C:\\CarbideIF_ARM\\WTI.dll"); //$NON-NLS-1$ |
|
842 configuration.setAttribute( SettingsData.spn_SophiaSTIConn_JtagClock, "Auto"); //$NON-NLS-1$ |
|
843 configuration.setAttribute( SettingsData.spn_SophiaSTIConn_LogOption, false); |
|
844 configuration.setAttribute( SettingsData.spn_SophiaSTIConn_StiEmulatorType, "Auto"); //$NON-NLS-1$ |
|
845 |
795 // Stop mode debugging using STI : specify Sophia STI debugger protocol plugin. |
846 // Stop mode debugging using STI : specify Sophia STI debugger protocol plugin. |
796 // |
847 // |
797 ConnectionTypeInfo connTI = new ConnectionTypeInfo( |
848 ConnectionTypeInfo connTI = new ConnectionTypeInfo( |
798 "Carbide Sophia STI", // Internal ID //$NON-NLS-1$ |
849 "Carbide Sophia STI", // Internal ID //$NON-NLS-1$ |
799 "Sophia STI Configuration", // Display name. //$NON-NLS-1$ |
850 "Sophia STI Configuration", // Display name. //$NON-NLS-1$ |