From 2809f8683c26eee3093a740491bfed0dea67db7d Mon Sep 17 00:00:00 2001 From: "kh5325.kim" Date: Thu, 7 Mar 2013 22:44:00 +0900 Subject: [PATCH] Removed TizenDebianLaunchDelegateForCore class --- .../launch/TizenDebianLaunchDelegateForCore.java | 231 --------------------- package/changelog | 3 + package/pkginfo.manifest | 2 +- 3 files changed, 4 insertions(+), 232 deletions(-) delete mode 100644 org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForCore.java diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForCore.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForCore.java deleted file mode 100644 index 9bcdd81..0000000 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForCore.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Native Platform - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Donghyuk Yang - * DongHee Yang - * Kangho Kim - * - * 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.nativeplatform.launch; - -import java.io.File; -import java.io.IOException; - -import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.debug.core.CDIDebugModel; -import org.eclipse.cdt.debug.core.CDebugUtils; -import org.eclipse.cdt.debug.core.ICDIDebugger2; -import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.debug.core.ICDebugConfiguration; -import org.eclipse.cdt.debug.core.cdi.ICDISession; -import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; -import org.eclipse.cdt.debug.mi.core.GDBCDIDebugger2; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.tizen.common.TizenPlatformConstants; -import org.tizen.common.connection.ui.TizenRemoteFileDialog; -import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult; -import org.tizen.nativecommon.launch.TizenLaunchMessages; -import org.tizen.sdblib.FileListingService.FileEntry; -import org.tizen.sdblib.MultiLineReceiver; -import org.tizen.sdblib.SyncService; -import org.tizen.sdblib.SyncService.SyncResult; - -public class TizenDebianLaunchDelegateForCore extends TizenDebianLaunchDelegate { - private FileEntry coreDir = null; - - @Override - protected void setDebugConfigAttributes(ILaunchConfiguration config) throws CoreException { - ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy(); - wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE); - wc.doSave(); - } - - @Override - protected void launchApplicationForDebug(ILaunch launch, ILaunchConfiguration config, IBinaryObject exeFile, IProgressMonitor monitor) throws CoreException, OperationCanceledException { - try { - monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION, 10); - monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION); - launchApplicationWithGDBClient(launch, config, exeFile, new SubProgressMonitor(monitor, 10)); - } finally { - monitor.done(); - } - } - - @Override - protected void launchApplicationWithGDBClient(ILaunch launch, ILaunchConfiguration config, IBinaryObject exeFile, IProgressMonitor monitor) throws CoreException { - ILaunchConfigurationWorkingCopy workingCopy = null; - try { - monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBCLIENT, 2); - monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBCLIENT); - - ICDebugConfiguration debugConfiguration = getDebugConfig(config); - String strPath = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, ""); - - if (strPath == null || strPath.length() == 0) { - IProject project = getProject(config); - FileEntry remotePath = promptForCoreFilePath(project, debugConfiguration); - if(remotePath == null) - newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, null); - String projectPath = project.getLocation().toOSString(); - String coreFilePath = projectPath + "/core." + project.getName(); - boolean isSuccess = false; - try { - isSuccess = downloadCoreFile(remotePath, coreFilePath, new SubProgressMonitor(monitor, 1)); - } catch (IOException e) { - newCoreException(TizenLaunchMessages.CANNOT_FIND_CORE_FILE, e); - } - - if(isSuccess == false) - newCoreException(TizenLaunchMessages.CANNOT_FIND_CORE_FILE, null); - - File coreFile = new File(coreFilePath.toString()); - IPath corePath = new Path(coreFilePath.toString()); - ICProject cproject = CDebugUtils.verifyCProject(config); - IBinaryObject core = verifyBinary(cproject, corePath); - if (!coreFile.canRead() || !(core.getType() == IBinaryObject.CORE)) - newCoreException(TizenLaunchMessages.INVALID_CORE_FILE, null); - - // Call again the launch delegate with the core file which user has selected. - workingCopy = config.getWorkingCopy(); - workingCopy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, coreFilePath); - workingCopy.launch(ILaunchManager.DEBUG_MODE, new SubProgressMonitor(monitor, 1)); - workingCopy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, ""); - workingCopy.doSave(); - // Coredump debugging finishes here. - return; - } - String appPath = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); - IPath hostPath = getHostPath(appPath, config); - - GDBCDIDebugger2 debugger = new GDBCDIDebugger2(); - ICDISession debugSession = ((ICDIDebugger2)debugger).createSession(launch, hostPath.toFile(), new SubProgressMonitor(monitor, 1)); - if(debugSession == null) - newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, null); - - ICDITarget[] targetArray = debugSession.getTargets(); - Process proc = null; - IProcess iproc = null; - for (int i = 0; i < targetArray.length; i++) { - proc = targetArray[i].getProcess(); - - if (proc != null) - iproc = DebugPlugin.newProcess(launch, proc, exeFile.getName(), null); - - IProject project = getProject(config); - CDIDebugModel.newDebugTarget(launch, project, targetArray[i], - "Tizen debugger", - iproc, exeFile, true, false, "false", true); - monitor.worked(1); - } - } catch (DebugException e) { - newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, e); - } catch (CoreException e) { - newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, e); - } catch (Exception e) { - newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, e); - } finally { - if (workingCopy != null) { - workingCopy.setAttribute( ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, ""); - workingCopy.doSave(); - } - monitor.done(); - } - } - - private FileEntry promptForCoreFilePath(final IProject project, ICDebugConfiguration debugConfig) throws CoreException { - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window == null) { - IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); - window = windows[0]; - } - - final Shell shell = window.getShell(); - if (shell != null) { - shell.getDisplay().syncExec(new Runnable() { - public void run() { - TizenRemoteFileDialog dlg = new TizenRemoteFileDialog(shell, "Select a directory where exist coredump file", currentDevice, true, TizenPlatformConstants.PUBICL_PLATFORM_CORE_PATH); - if (dlg.open() == TizenRemoteFileDialogResult.OK) - coreDir = dlg.getSelectedFileEntry(); - else - coreDir = null; - } - }); - } - return coreDir; - } - - private boolean downloadCoreFile(FileEntry coreDir, String destFilePath, IProgressMonitor monitor) throws IOException { - if (coreDir == null) - return false; - String command = "ls -lt " + coreDir.getFullPath(); - currentDevice.executeShellCommand(command, new MultiLineReceiver() { - @Override - public void processNewLines(String[] lines) { - for (String line : lines) { - if (line.contains("core")) { - executeResult = line.substring(line.indexOf("core")); - break; - } - } - } - }); - - if (!executeResult.startsWith("core")) - return false; - - FileEntry[] coreFiles = coreDir.getFileListingService().getChildren(coreDir, true, null); - FileEntry found = null; - for (FileEntry file : coreFiles) { - if (file.getName().equals(executeResult)) { - found = file; - break; - } - } - - if (found == null) - return false; - - SyncResult result = currentDevice.getSyncService().pullFile(found.getFullPath(), destFilePath, true, SyncService.getNullProgressMonitor()); - - if (result.getCode() == SyncService.RESULT_OK) - return true; - else - return false; - } -} \ No newline at end of file diff --git a/package/changelog b/package/changelog index 7db8257..f55bc86 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,6 @@ +* 1.0.51 +- Removed TizenDebianLaunchDelegateForCore class +== kh5325.kim 2013-03-07 * 1.0.50 - Fixed bug for displaying new version on installed version field == donghyuk yang 2013-02-22 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index c1920e6..187cca6 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,4 +1,4 @@ -Version:1.0.50 +Version:1.0.51 Source:nativeplatform-eplugin Maintainer:Kangho Kim , Yoonki Park, Hyunsik Noh, Gun Kim, Ho Namkoong, Taeyoung Son -- 2.7.4