[Title] bug fix of oprofile and valgrind
authorJaewon Lim <jaewon81.lim@samsung.com>
Tue, 13 Nov 2012 11:24:31 +0000 (20:24 +0900)
committerJaewon Lim <jaewon81.lim@samsung.com>
Tue, 13 Nov 2012 11:24:31 +0000 (20:24 +0900)
[Desc.] problem that cannot launch oprofile and valgrind
[Issue] nabi 13872

org.eclipse.linuxtools.oprofile.launch.exe/src/org/tizen/oprofile/launch/TizenOprofileLaunchDelegate.java
org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/TizenValgrindLaunchDelegate.java
org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/valgrind/massif/MassifLaunchDelegate.java
org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/valgrind/memcheck/MemcheckLaunchDelegate.java

index d964649..ce4ea03 100644 (file)
@@ -52,6 +52,7 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.tizen.common.TizenPlatformConstants;
 import org.tizen.nativecommon.launch.IProjectLaunchCommand;
+import org.tizen.nativecommon.launch.TizenLaunchCommand;
 import org.tizen.nativecommon.launch.TizenLaunchDelegate;
 import org.tizen.nativecommon.launch.TizenLaunchMessages;
 import org.tizen.oprofile.core.CommandManager;
@@ -65,6 +66,7 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate {
 
        protected static final String PACKAGE_NAME = "oprofile";
        protected static final String PACKAGE_FILENAME_ARM = "oprofile_armel.deb";
+       protected static final String BADA_EXT = ".exe";
 
        protected static String appName = null;
 
@@ -93,6 +95,11 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate {
                        verifyBuildConfiguration(config, mode, new SubProgressMonitor(
                                        monitor, 11));
 
+                       setConsole(config);
+            tizenCommand = new TizenLaunchCommand(currentDevice, launchConsole);
+            // FIXME: ad-hoc code.
+            launchConsole.show();
+
                        Oprofile.getOpInfo();
 
                        // ISession session = getLaunchSession(config, new
@@ -131,6 +138,14 @@ public class TizenOprofileLaunchDelegate extends TizenLaunchDelegate {
 
                        IPath exeFile = CDebugUtils.verifyProgramPath(config);
                        remoteExePath += exeFile.toFile().getName();
+
+                       // for bada application
+                       // execute non-exe file instead of .exe file
+                       if(remoteExePath.endsWith(BADA_EXT))
+                       {
+                               remoteExePath = remoteExePath.substring(0, remoteExePath.length() - BADA_EXT.length());
+                       }
+
                        String cmd = "ls " + remoteExePath + TizenPlatformConstants.CMD_SUFFIX;
                        // resultRsp = session.run(cmd, null);
                        String[] resultRsp = CommandManager.runCommandReturningResultArray(cmd);
index 89d4ea2..d12e55c 100644 (file)
@@ -54,6 +54,7 @@ import org.tizen.common.TizenPlatformConstants;
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.nativecommon.ProjectUtil;
 import org.tizen.nativecommon.launch.IProjectLaunchCommand;
+import org.tizen.nativecommon.launch.TizenLaunchCommand;
 import org.tizen.nativecommon.launch.TizenLaunchDelegate;
 import org.tizen.nativecommon.launch.TizenLaunchMessages;
 import org.tizen.sdblib.IDevice;
@@ -103,6 +104,11 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                                        new SubProgressMonitor(monitor, 9));
                        verifyBuildConfiguration(config, mode, new SubProgressMonitor(monitor, 11));
 
+                       setConsole(config);
+            tizenCommand = new TizenLaunchCommand(currentDevice, launchConsole);
+            // FIXME: ad-hoc code.
+            launchConsole.show();
+
                        // getLaunchSession(config, new SubProgressMonitor(monitor, 1));
 
                        if (mode.equals(ILaunchManager.PROFILE_MODE)) {
index d010c28..501d8d4 100644 (file)
@@ -29,6 +29,7 @@ import org.eclipse.linuxtools.valgrind.launch.ValgrindLaunchPlugin;
 import org.eclipse.linuxtools.valgrind.ui.IValgrindToolView;
 import org.eclipse.linuxtools.valgrind.ui.ValgrindUIPlugin;
 import org.eclipse.linuxtools.valgrind.ui.ValgrindViewPart;
+import org.tizen.nativecommon.launch.TizenLaunchCommand;
 import org.tizen.nativecommon.launch.TizenLaunchDelegate;
 
 public class MassifLaunchDelegate extends TizenLaunchDelegate implements
@@ -89,6 +90,7 @@ public class MassifLaunchDelegate extends TizenLaunchDelegate implements
                        String targetlog_massif = ValgrindLaunchPlugin.RESULT_DIR
                                        + OUT_FILE;
                        String hostlog_massif = ValgrindHostdir + File.separator + OUT_FILE;
+
                        // --bery sftp dowonload
                        // session.downloadFile(targetlog_massif,hostlog_massif);
                        File file = new File(hostlog_massif);
index f980d28..cbffe30 100644 (file)
@@ -29,6 +29,7 @@ import org.eclipse.linuxtools.valgrind.launch.ValgrindLaunchPlugin;
 import org.eclipse.linuxtools.valgrind.ui.IValgrindToolView;
 import org.eclipse.linuxtools.valgrind.ui.ValgrindUIPlugin;
 import org.eclipse.linuxtools.valgrind.ui.ValgrindViewPart;
+import org.tizen.nativecommon.launch.TizenLaunchCommand;
 import org.tizen.nativecommon.launch.TizenLaunchDelegate;
 import org.xml.sax.SAXException;
 
@@ -59,7 +60,8 @@ public class MemcheckLaunchDelegate extends TizenLaunchDelegate implements IValg
                    String ValgrindHostdir = ValgrindUIPlugin.getDefault().getStateLocation().toOSString();
                    String targetlog=ValgrindLaunchPlugin.RESULT_DIR +"valgrind.xml";
                    String hostlog =ValgrindHostdir + File.separator + "valgrind_out.xml";
-                   //--bery sftp dowonload
+
+                               //--bery sftp dowonload
                    File file = new File(hostlog);
                    if(file.exists()){
                        file.delete();