class="org.tizen.dynamicanalysis.ide.eplugin.communication.ServerStartup">
</startup>
</extension>
-
- <extension point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
- <toolChain
- id="org.tizen.nativecpp.toolchain.sbi.gnu.da"
- isAbstract="false"
- superClass="org.tizen.nativecpp.toolchain.sbi.gnu">
- <tool
- id="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler.da"
- isAbstract="false"
- superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.compiler">
- <option
- category="gnu.cpp.compiler.category.other"
- command="-g -pg -funwind-tables -finstrument-functions"
- defaultValue="true"
- id="sbi.gnu.cpp.compiler.option.misc.pic.da"
- name="Dynamic Analyzer Option"
- superClass="sbi.gnu.cpp.compiler.option.misc.pic.cpp"
- valueType="boolean">
- </option>
- </tool>
- <tool
- id="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker.da"
- isAbstract="false"
- superClass="org.tizen.nativecpp.tool.sbi.gnu.cpp.linker">
- <option
- category="gnu.cpp.link.category.options"
- command="-pg"
- defaultValue="true"
- id="sbi.gnu.cpp.linker.option.da_flag.cpp"
- name="Dynamic Analyzer Option"
- superClass="gnu.cpp.link.option.shared"
- valueHandler="org.tizen.dynamicanalysis.ide.eplugin.launch.DynamicOptionValueHandler"
- valueType="boolean">
- </option>
- </tool>
- </toolChain>
- <projectType
- buildArtefactType="org.tizen.nativecpp.buildArtefactType.app"
- id="org.tizen.nativecpp.target.sbi.gcc45.app.da">
- <configuration
- buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug"
- id="org.tizen.nativecpp.config.sbi.gcc45.app.debug.da"
- name="Dynamic Analyzer"
- parent="org.tizen.nativecpp.config.sbi.gcc45.app.debug">
- <toolChain
- id="org.tizen.nativecpp.toolchain.sbi.gcc45.app.debug.da"
- superClass="org.tizen.nativecpp.toolchain.sbi.gnu.da">
- </toolChain>
- </configuration>
- </projectType>
- <projectType
- buildArtefactType="org.tizen.nativecpp.buildArtefactType.app"
- id="org.tizen.nativecpp.target.sbi.gcc45.app.da.2.0">
- <configuration
- id="org.tizen.nativecpp.config.sbi.gcc45.app.debug.emulator.da"
- name="DA-Tizen-Emulator"
- parent="org.tizen.nativecpp.config.sbi.gcc45.app.debug.emulator">
- <toolChain
- id="org.tizen.nativecpp.toolchain.sbi.gcc45.app.debug.emulator.da"
- isAbstract="true"
- superClass="org.tizen.nativecpp.toolchain.sbi.gnu.da">
- </toolChain>
- </configuration>
- <configuration
- id="org.tizen.nativecpp.config.sbi.gcc45.app.debug.device.da"
- name="DA-Tizen-Device"
- parent="org.tizen.nativecpp.config.sbi.gcc45.app.debug.device">
- <toolChain
- id="org.tizen.nativecpp.toolchain.sbi.gcc45.app.debug.device.da"
- isAbstract="true"
- superClass="org.tizen.nativecpp.toolchain.sbi.gnu.da">
- </toolChain>
- </configuration>
- </projectType>
- </extension>
- <extension
+ <extension
point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
class="org.tizen.dynamicanalysis.ide.eplugin.launch.TizenNativeApplicationDAShortcut"
</launchConfigurationTabGroup>
</extension>
- <extension
- point="org.eclipse.debug.ui.launchConfigurationTabs">
- <tab
- class="org.tizen.dynamicanalysis.ide.eplugin.launch.TizenNativeApplicationDAMainTab"
- group="%daProfileConfigTabGroupID"
- id="%daProfileConfigTabsID"
- name="Tizen Main Tab">
- <associatedDelegate delegate="%daProfileDelegateID"/>
- </tab>
- </extension>
<extension
id="org.tizen.dynamicanalysis.ide.eplugin.dacustom"
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.tizen.dynamicanalysis.ide.eplugin.communication.ServerStartup;
-import org.tizen.dynamicanalysis.ide.eplugin.launch.PlatformChangingHandler;
-import org.tizen.nativecommon.build.PlatformChangingManager;
-import org.tizen.nativecommon.build.ui.IPlatformChangedListener;
public class Activator implements BundleActivator {
public static final String PLUGIN_ID = "org.tizen.dynamicanalyzer";//$NON-NLS-1$
- public static final String DA_BUILD_CONFIGURATION_NAME_EMULATOR = "DA-Tizen-Emulator";//$NON-NLS-1$
- public static final String DA_BUILD_CONFIGURATION_NAME_DEVICE = "DA-Tizen-Device";//$NON-NLS-1$
- public static final String DA_BUILD_CONFIGURATION_NAME_PROFILE = "Profile";//$NON-NLS-1$
- public static final String DA_BUILD_CONFIGURATION_NAME = "Dynamic Analyzer";//$NON-NLS-1$
public static final String PROFILE_MODE = "profile";//$NON-NLS-1$
private static BundleContext context;
- public static IPlatformChangedListener listner = new PlatformChangingHandler(DA_BUILD_CONFIGURATION_NAME);
static BundleContext getContext() {
return context;
*/
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
- PlatformChangingManager.addListener(listner);
}
/*
import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.internal.core.FolderInfo;
-import org.tizen.dynamicanalysis.ide.eplugin.Activator;
@SuppressWarnings("restriction")
public class DynamicOptionValueHandler implements IManagedOptionValueHandler {
} else {
config = (IConfiguration) configuration;
}
-
- Activator.listner.platformChanged(config);
-
return false;
}
+++ /dev/null
-/*
- * Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Jungwook Ryu <jungwook.ryu@samsung.com>
- * Sanghyun Lee <sanghyunnim.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-package org.tizen.dynamicanalysis.ide.eplugin.launch;
-
-import org.eclipse.cdt.managedbuilder.core.IConfiguration;
-import org.tizen.nativecommon.build.CommonConfigurationManager;
-import org.tizen.nativecommon.build.ui.IPlatformChangedListener;
-
-public class PlatformChangingHandler implements IPlatformChangedListener {
-
- private String configName = "";
-
- public PlatformChangingHandler() {
-
- }
-
- public PlatformChangingHandler(String c) {
- configName = c;
- }
-
- @Override
- public String getConfigName() {
- return configName;
- }
-
- @Override
- public void platformChanged(IConfiguration config) {
- String linklib = "daprobe";//$NON-NLS-1$
- String customchartSymbol = "_USE_DA_"; //$NON-NLS-1$
- String libPath = "\"${SDK_INSTALL_PATH}/library/da";//$NON-NLS-1$
- String deviceLibPath = libPath + "/arm\"";
- String emulatorLibPath = libPath + "/x86\"";
-
- String targetStr = "";
- String replacementStr = "";
-
- String arch = CommonConfigurationManager.getArchitecture(config);
-
- // Default setting is emulator arch
- if (CommonConfigurationManager.isDeviceArch(arch)) {
- targetStr = emulatorLibPath;
- replacementStr = deviceLibPath;
- } else {
- targetStr = deviceLibPath;
- replacementStr = emulatorLibPath;
- }
-
- String includePath = "\"${SDK_INSTALL_PATH}/library\"";//$NON-NLS-1$
- CommonConfigurationManager.appendIncludePathToCompiler(config, includePath);
- CommonConfigurationManager.appendLibraryToLinker(config, linklib);
- CommonConfigurationManager.replaceLinkPathsToLinker(config, targetStr, replacementStr);
- CommonConfigurationManager.appendPreprocessorSymbolToCompiler(config, customchartSymbol);
- }
-
-}
private void rollBackBuildConfigSetting(IProject project) {
String prevBuildConfigName = TizenNativeApplicationDAShortcut
.getPrevBuildConfigName();
- String prevDAConfigArch = TizenNativeApplicationDAShortcut
- .getPrevDAConfigArch();
-
if (prevBuildConfigName != null) {
ManagedBuildManager.getBuildInfo(project).setDefaultConfiguration(
prevBuildConfigName);
}
-
- if (prevDAConfigArch != null) {
- PlatformChangingManager.changePlatform(project,
- Activator.DA_BUILD_CONFIGURATION_NAME, prevDAConfigArch,
- false);
- }
}
@Override
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
import org.tizen.common.connection.ConnectionPlugin;
import org.tizen.common.gom.launch.GomLaunchData;
import org.tizen.common.util.DialogUtil;
import org.tizen.common.util.OSChecker;
import org.tizen.common.util.SWTUtil;
-import org.tizen.dynamicanalysis.ide.eplugin.Activator;
import org.tizen.dynamicanalysis.ide.eplugin.DALog;
import org.tizen.dynamicanalysis.ide.eplugin.nl.Labels;
import org.tizen.nativecommon.IXMLStore;
import org.tizen.nativecommon.ProjectUtil;
import org.tizen.nativecommon.build.CommonBuildConstants;
import org.tizen.nativecommon.build.CommonBuildMessages;
-import org.tizen.nativecommon.build.CommonConfigurationManager;
-import org.tizen.nativecommon.build.PlatformChangingManager;
import org.tizen.nativecommon.build.SmartBuildInterface;
import org.tizen.nativecommon.launch.LaunchUtils;
import org.tizen.nativecommon.launch.TizenLaunchConfiguration;
import org.tizen.nativeplatform.util.PlatformLaunchUtil;
import org.tizen.nativeplatform.util.PlatformProjectUtil;
import org.tizen.nativeplatform.views.model.PlatformRootstrap;
-import org.tizen.sdblib.Arch;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.util.ArrayUtil;
public class TizenNativeApplicationDAShortcut extends TizenLaunchShortcut {
private static String prevBuildConfigName = null;
- private static String prevDAConfigArch = null;
/* for platform project */
protected PkgCommandTarget target = null;
return returnValue;
}
- static String getPrevDAConfigArch() {
- String returnVaString = prevDAConfigArch;
- prevDAConfigArch = null;
-
- return returnVaString;
- }
-
@Override
public void launch(ISelection selection, String mode) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
DALog.dlgErrorMessage(Labels.MESSAGE_ERROR,
Labels.MESSAGE_NOT_SUPPORT_IME_PROJECT);
} else {
- setDABuildConfig(project);
searchAndLaunch(((IStructuredSelection) selection).toArray(),
mode);
}
DALog.dlgErrorMessage(Labels.MESSAGE_ERROR,
Labels.MESSAGE_NOT_SUPPORT_IME_PROJECT);
} else {
- setDABuildConfig(project);
searchAndLaunch(new Object[] { editor.getEditorInput() }, mode);
}
} catch (CoreException e) {
return false;
}
- private void setDABuildConfig(IProject project) throws CoreException {
- IDevice device = LaunchUtils.getCurrentDeployDevice();
- if (device == null) {
- throw new CoreException(new Status(Status.ERROR,
- Activator.PLUGIN_ID, Status.INFO,
- TizenLaunchMessages.CANNOT_CONNECT_TO_DEVICE, null));
- }
-
- prevBuildConfigName = ManagedBuildManager.getBuildInfo(project)
- .getConfigurationName();
-
- String configName;
- IConfiguration daConfig = PlatformChangingManager
- .getConfigurationByName(project,
- Activator.DA_BUILD_CONFIGURATION_NAME);
-
- if (daConfig != null) {
- prevDAConfigArch = CommonConfigurationManager
- .getArchitecture(daConfig);
- configName = Activator.DA_BUILD_CONFIGURATION_NAME;
- } else {
- daConfig = PlatformChangingManager.getConfigurationByName(project,
- Activator.DA_BUILD_CONFIGURATION_NAME_PROFILE);
- if (daConfig != null) {
- configName = Activator.DA_BUILD_CONFIGURATION_NAME_PROFILE;
- } else {
- if (device.getArch() == Arch.X86) {
- configName = Activator.DA_BUILD_CONFIGURATION_NAME_EMULATOR;
- } else {
- configName = Activator.DA_BUILD_CONFIGURATION_NAME_DEVICE;
- }
- }
- }
-
- PlatformChangingManager.changePlatform(project, configName, device
- .getArch().getArch());
- }
private void rollBackBuildConfigSetting(IProject project) {
if (prevBuildConfigName != null) {
prevBuildConfigName);
prevBuildConfigName = null;
}
-
- if (prevDAConfigArch != null) {
- PlatformChangingManager.changePlatform(project,
- Activator.DA_BUILD_CONFIGURATION_NAME, prevDAConfigArch,
- false);
- prevDAConfigArch = null;
- }
}
@Override