VALGRIND: unsupport 3.0 platform
authorwoojin <woojin2.jung@samsung.com>
Wed, 21 Dec 2016 22:41:38 +0000 (07:41 +0900)
committerwoojin <woojin2.jung@samsung.com>
Wed, 21 Dec 2016 22:54:05 +0000 (07:54 +0900)
do not support 3.0 platform
bring error popup when try to profile as valgrind with 3.0 platform

Change-Id: I450d201b6a814cb8515c2d29aada7ef9b8f553bc
Signed-off-by: woojin <woojin2.jung@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
org.eclipse.linuxtools.valgrind.nativelaunch.exe/src/org/eclipse/linuxtools/valgrind/launch/TizenValgrindLaunchDelegate.java

index 8955cb0..b04824e 100644 (file)
@@ -102,6 +102,7 @@ import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
 import org.tizen.sdblib.Arch;
 import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.PlatformCapability;
 import org.tizen.sdblib.SmartDevelopmentBridge;
 
 public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
@@ -216,6 +217,14 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                        return;
                } 
                
+               // check platform version - 3.0 is not supported yet
+               if (isPlatform30()) {
+                       monitor.setCanceled(true);
+                       ProfileLaunchShortcut.showErrorDialog(
+                                       Messages.getString("ValgrindOptionsTab.cannotrun"),
+                                       Messages.getString("TizenValgrindLaunchDelegate.unsupported_platform"), null);
+                       return;
+               }
                // check for Valgrind executable
                if (!CommandManager.isExist(TizenPlatformConstants.TOOLS_TARGET_PATH + VALGRIND_EXECUTABLE_PATH)) {
                        Display.getDefault().syncExec(new Runnable() {
@@ -1095,4 +1104,19 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                        super();
                }
        }
+
+       private static boolean isPlatform30() {
+               PlatformCapability capa;
+               try {
+                       capa = ConnectionPlugin.getDefault().getCurrentDevice().getPlatformCapability();
+                       if (PlatformCapability.ENABLED.equals(capa.getMultiuserSupport())) {
+                               return true;
+                       } else {
+                               return false;
+                       }
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+               return false;
+       }
 }
index 32f1e29..1c24811 100644 (file)
@@ -6,6 +6,7 @@ TizenValgrindLaunchDelegate.platform_library_project_execution_error=Input execu
 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=The valgrind profiling was failed because the application was terminated abnormally. Or the HW capacity of the target may be too low to support valgrind profiling. In this case, we recommend to use the emulator.
+TizenValgrindLaunchDelegate.unsupported_platform=The target platform does not support the valgrind profiling.
 TizenValgrindLaunchDelegate.valgrind_warning=Valgrind warning!!
 ValgrindDebugPlugin.invalid_extension_point=Invalid extension point.
 ValgrindDebugPlugin.invalid_extension_registry=Invalid extension registry.
index 510eaba..33a8fab 100644 (file)
@@ -96,6 +96,7 @@ import org.tizen.nativecommon.launch.TizenLaunchMessages;
 import org.tizen.nativecommon.launch.ui.TizenLaunchDeviceSelectionDialog;
 import org.tizen.sdblib.Arch;
 import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.PlatformCapability;
 import org.tizen.sdblib.SmartDevelopmentBridge;
 
 public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
@@ -208,6 +209,14 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                        return;
                } 
                
+               // check platform version - 3.0 is not supported yet
+               if (isPlatform30()) {
+                       monitor.setCanceled(true);
+                       ProfileLaunchShortcut.showErrorDialog(
+                                       Messages.getString("ValgrindOptionsTab.cannotrun"),
+                                       Messages.getString("TizenValgrindLaunchDelegate.unsupported_platform"), null);
+                       return;
+               }
                // check for Valgrind executable
                if (!CommandManager.isExist(TizenPlatformConstants.TOOLS_TARGET_PATH + VALGRIND_EXECUTABLE_PATH)) {
                        Display.getDefault().syncExec(new Runnable() {
@@ -792,4 +801,19 @@ public class TizenValgrindLaunchDelegate extends TizenLaunchDelegate {
                        super();
                }
        }
+
+       private static boolean isPlatform30() {
+               PlatformCapability capa;
+               try {
+                       capa = ConnectionPlugin.getDefault().getCurrentDevice().getPlatformCapability();
+                       if (PlatformCapability.ENABLED.equals(capa.getMultiuserSupport())) {
+                               return true;
+                       } else {
+                               return false;
+                       }
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+               return false;
+       }
 }