Common : fix potential bug (Valgrind) 08/26308/3
authorseokgil.kang <seokgil.kang@samsung.com>
Wed, 20 Aug 2014 11:17:51 +0000 (20:17 +0900)
committerseokgil.kang <seokgil.kang@samsung.com>
Thu, 21 Aug 2014 04:20:44 +0000 (13:20 +0900)
Change-Id: I1f296b3b2e5baf936c4609f1fdcd0671cbb20673
Signed-off-by: seokgil.kang <seokgil.kang@samsung.com>
org.eclipse.linuxtools.valgrind.launch.exe/src/org/eclipse/linuxtools/valgrind/launch/TizenValgrindLaunchDelegate.java
org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/valgrind/launch/messages.properties

index 3167265..03d7b9b 100644 (file)
@@ -644,8 +644,10 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                                String[] resultRsp = CommandManager.runHostCommandReturningResult(cmd);
                                if (!CommandManager.isRunSuccessfuly(resultRsp))
                                {
-                                       newCoreException(Messages.getString("TizenValgrindLaunchDelegate.valgrind_error_message"),      new Exception(
-                                                       "Executable does not exist on a valid path. You must install your application before running it."));
+                                       newCoreException(
+                                                       Messages.getString("TizenValgrindLaunchDelegate.valgrind_error_message"),
+                                                       new Exception(
+                                                                       Messages.getString("TizenValgrindLaunchDelegate.executable_file_does_not_exist")));
                                }
                        }
                        
@@ -819,7 +821,16 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                                fullcommand += LAUNCHPAD_LAUNCHER + appId[0] + LAUNCHPAD_SYNCMODE;
                        } else {
                                /** platform library */
-                               fullcommand += LAUNCHPAD_LAUNCHER + CDebugUtils.getProgramPath(config).toString() + LAUNCHPAD_SYNCMODE;
+                               IPath programPath = CDebugUtils.getProgramPath(config);
+                               if (programPath == null) {
+                                       String errorMsg = Messages
+                                                       .getString("TizenValgrindLaunchDelegate.platform_library_project_execution_error")
+                                                       + " \"" + project.getName() + "\" project."; 
+                                       newCoreException(
+                                                       Messages.getString("TizenValgrindLaunchDelegate.valgrind_error_message"),
+                                                       new Exception(errorMsg));
+                               }
+                               fullcommand += LAUNCHPAD_LAUNCHER + programPath.toString() + LAUNCHPAD_SYNCMODE;
                        }
 
                        StringBuffer buf = new StringBuffer(fullcommand);
index a0fedaf..7ab4f80 100644 (file)
@@ -1,5 +1,7 @@
 TizenValgrindLaunchDelegate.ld_file_doesnt_exist=The target device does not support the valgrind profiling.
+TizenValgrindLaunchDelegate.executable_file_does_not_exist=Executable file of the application does not exist on a valid path. You must install your application before running it.
 TizenValgrindLaunchDelegate.failed_to_valgrind_installation=Failed to the Valgrind installation.
+TizenValgrindLaunchDelegate.platform_library_project_execution_error=Input executable file to profile
 TizenValgrindLaunchDelegate.valgrind_binary_doesnt_exist=The SDK does not have valgrind packages, it may be corrupted. Please try to re-install the SDK.
 TizenValgrindLaunchDelegate.valgrind_doesnt_exist=The IDE will install the valgrind to the target device. The valgrind possesses 7MB of the device's storage.\nThe valgrind can profile your application in stable when the device's available memory size is more than 150MB.\nDo you want to continue installing the valgrind?
 TizenValgrindLaunchDelegate.valgrind_error_message=This target does not support profiling with valgrind for low HW specifications.