Upload tizen_2.1 source tizen_2.1 2.1b_release
authorkh5325.kim <kh5325.kim@samsung.com>
Mon, 22 Apr 2013 10:47:54 +0000 (19:47 +0900)
committerkh5325.kim <kh5325.kim@samsung.com>
Mon, 22 Apr 2013 10:47:54 +0000 (19:47 +0900)
Change-Id: I702db033121744a894bcc01d2ca28823fa50d170

org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegate.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchDelegateForAttach.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchMessages.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/TizenDebianLaunchMessages.properties
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/wizards/PlatformLaunchUtils.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/wizards/PlatformLaunchWizard.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkgmgr/RPMPackageCommander.java
package/changelog
package/pkginfo.manifest

index 79ffd14..fe76771 100644 (file)
@@ -32,7 +32,6 @@ import java.io.FilenameFilter;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
 import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
 import org.eclipse.cdt.core.settings.model.ICProjectDescription;
@@ -80,6 +79,7 @@ import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.util.DialogUtil;
 import org.tizen.common.util.LocalPortChecker;
 import org.tizen.common.util.SWTUtil;
+import org.tizen.common.util.StringUtil;
 import org.tizen.nativecommon.build.CommonBuildMessages;
 import org.tizen.nativecommon.build.CommonConfigurationManager;
 import org.tizen.nativecommon.build.CommonProjectDependentBuilder;
@@ -97,8 +97,6 @@ import org.tizen.nativeplatform.build.PlatformProjectPackaging;
 import org.tizen.nativeplatform.launch.wizards.PlatformLaunchUtils;
 import org.tizen.nativeplatform.launch.wizards.ShowPackageStatusDialog;
 import org.tizen.nativeplatform.pkgmgr.model.LocalPackage;
-import org.tizen.nativeplatform.rootstrap.RootstrapManager;
-import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 import org.tizen.sdblib.IDevice;
 import org.tizen.sdblib.IDevice.Arch;
 import org.tizen.sdblib.SdbCommandRejectedException;
@@ -345,7 +343,8 @@ public class TizenDebianLaunchDelegate extends AbstractCLaunchDelegate {
 
                        monitor.done(); 
                } catch (InterruptedException e) {
-                       e.printStackTrace();
+                       // This exception is occurred if device is not root on or failed to install
+                       newCoreException(TizenDebianLaunchMessages.FAILED_INSTALL_PKGS, e);                     
                }               
     }
 
@@ -489,10 +488,12 @@ public class TizenDebianLaunchDelegate extends AbstractCLaunchDelegate {
             monitor.subTask(TizenLaunchMessages.PREPARE_TO_LAUNCH);
 
             currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-            if (currentDevice == null)
+            if (currentDevice == null) {
                 newCoreException(TizenLaunchMessages.CANNOT_CONNECT_TO_DEVICE, null);
-            if (currentDevice.isOffline())
+            }
+            if (currentDevice.isOffline()) {
                 newCoreException(TizenLaunchMessages.CANNOT_CONNECT_TO_DEVICE, null);
+            }            
         } finally {
             monitor.done();
         }
@@ -528,30 +529,39 @@ public class TizenDebianLaunchDelegate extends AbstractCLaunchDelegate {
     }
 
     protected void launchApplicationWithGDBServer(ILaunch launch, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException {
+       
         try {
             monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER, 1);
-            monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER);            
+            monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER);
             
-               IPath path = getHostPath(TizenPlatformConstants.HOST_GDBSERVER_PATH, config);
-               PlatformLaunchUtils launchUtils = new PlatformLaunchUtils();                    
-               launchUtils.readyGdbServer(currentDevice, tizenCommand, path);
-               
-            String gdbserverPort = config.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);           
-            String gdbserverCmd = TizenPlatformConstants.GDBSERVER_PLATFORM_CMD + " :" + gdbserverPort;
-            String execArg = setArguments(config);
-            String envCmd = setEnvironments(config);
-            String command = envCmd + gdbserverCmd + " " + execArg;
-            serverProc = currentDevice.executeShellCommand(command);
-               } catch (TimeoutException e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
-               } catch (SdbCommandRejectedException e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
+            IPath path = getHostPath(TizenPlatformConstants.HOST_GDBSERVER_PATH, config);
+            PlatformLaunchUtils launchUtils = new PlatformLaunchUtils();
+            launchUtils.readyGdbServer(currentDevice, tizenCommand, path);
+
+            String gdbserverRunCommand = getGdbserverRunCommand(config);
+            String resultCommand = null;
+
+            // is gdbserver running now ? then
+            resultCommand = String.format(TizenPlatformConstants.PROCESS_GET_PROCESS_ID_COMMAND, gdbserverRunCommand.trim());
+            tizenCommand.run(resultCommand, null);
+            if (tizenCommand.getEndLine() != null) {
+                if (StringUtil.isInteger(tizenCommand.getEndLine().trim())) {
+                    resultCommand = String.format(TizenPlatformConstants.PROCESS_SIGKILL_COMMAND, tizenCommand.getEndLine() + TizenPlatformConstants.CMD_RESULT_CHECK);
+                    try {
+                        tizenCommand.run(resultCommand, "0");
+                    } catch (CoreException e) {
+                       newCoreException(TizenLaunchMessages.GDBSERVER_ALREADY_RUNNING, null);
+                    } catch (Exception e) {                        
+                       newCoreException(TizenLaunchMessages.GDBSERVER_ALREADY_RUNNING, null);
+                    }
+                }
+            }
+            // Run gdbserver as blocking mode!
+            tizenCommand.run(gdbserverRunCommand, null, true);
         } catch (CoreException e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
-        } catch (IOException e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
+               newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
         } catch (Exception e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
+               newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);            
         } finally {
             monitor.done();
         }
@@ -563,7 +573,8 @@ public class TizenDebianLaunchDelegate extends AbstractCLaunchDelegate {
             monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBCLIENT);
 
             TizenDebugger debugger = new TizenDebugger();
-            debugSession = ((ICDIDebugger2)debugger).createSession(launch, exeFile.getPath().toFile(), new SubProgressMonitor(monitor, 1));
+            debugSession = ((ICDIDebugger2)debugger).createSession(launch,
+                       getGDBClientArgument(exeFile), new SubProgressMonitor(monitor, 1));
             if(debugSession == null)
                 newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBCLIENT, null);
 
@@ -593,6 +604,18 @@ public class TizenDebianLaunchDelegate extends AbstractCLaunchDelegate {
             monitor.done();
         }
     }
+    
+    protected String getGdbserverRunCommand(ILaunchConfiguration config) 
+               throws CoreException, Exception {
+        
+        String gdbserverPort = config.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);           
+        String gdbserverCmd = TizenPlatformConstants.GDBSERVER_PLATFORM_CMD + " :" + gdbserverPort;
+        String execArg = setArguments(config);
+        String envCmd = setEnvironments(config);
+        String command = envCmd + gdbserverCmd + " " + execArg;
+
+        return command;
+    }   
 
     protected void setDebugConfigAttributes(ILaunchConfiguration config) throws CoreException {
         ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
@@ -746,4 +769,8 @@ public class TizenDebianLaunchDelegate extends AbstractCLaunchDelegate {
                
                return result;
        }
+       
+    protected File getGDBClientArgument(IBinaryObject exeFile) {
+        return exeFile.getPath().toFile();
+    }
 }
index a146d21..58d06d4 100644 (file)
 
 package org.tizen.nativeplatform.launch;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
 
 import org.eclipse.cdt.core.IProcessInfo;
+import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
 import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
 import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
+import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.utils.PathUtil;
 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.Path;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.debug.core.ILaunch;
 import org.eclipse.debug.core.ILaunchConfiguration;
@@ -45,6 +53,8 @@ import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
 import org.eclipse.debug.core.ILaunchManager;
 import org.tizen.common.TizenPlatformConstants;
 import org.tizen.common.util.DialogUtil;
+import org.tizen.common.util.StringUtil;
+import org.tizen.nativecommon.ProjectUtil;
 import org.tizen.nativecommon.build.SmartBuildInterface;
 import org.tizen.nativecommon.build.exception.SBIException;
 import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants;
@@ -52,7 +62,6 @@ import org.tizen.nativecommon.launch.TizenLaunchMessages;
 import org.tizen.nativeplatform.build.PlatformConfigurationManager;
 import org.tizen.nativeplatform.launch.wizards.PlatformLaunchUtils;
 import org.tizen.nativeplatform.pkgmgr.model.LocalPackage;
-import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.sdblib.SdbCommandRejectedException;
 import org.tizen.sdblib.TimeoutException;
 
@@ -63,6 +72,8 @@ public class TizenDebianLaunchDelegateForAttach extends TizenDebianLaunchDelegat
 
     @Override
     protected void setDebugConfigAttributes(ILaunchConfiguration config) throws CoreException {
+       
+       setSharedlibrarySearchPath(config);     
         ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
 
         pid = wc.getAttribute(ITizenLaunchConfigurationConstants.ATTR_PROCESSID_OPTION, -1);
@@ -76,7 +87,7 @@ public class TizenDebianLaunchDelegateForAttach extends TizenDebianLaunchDelegat
                 newCoreException(TizenLaunchMessages.CANNOT_CREATE_FORWARD, null);
             currentDevice.createForward(localDebugPort, Integer.parseInt(gdbserverPort));
             String localPort = Integer.valueOf(localDebugPort).toString();
-            wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, localPort);
+            wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, localPort);            
             wc.doSave();
                } catch (TimeoutException e) {
             newCoreException(TizenLaunchMessages.CANNOT_CREATE_FORWARD, e);
@@ -86,9 +97,87 @@ public class TizenDebianLaunchDelegateForAttach extends TizenDebianLaunchDelegat
             newCoreException(TizenLaunchMessages.CANNOT_CREATE_FORWARD, e);
         } catch (IOException e) {
             newCoreException(TizenLaunchMessages.CANNOT_CREATE_FORWARD, e);
+        }        
+    }
+    
+    private void setSharedlibrarySearchPath(ILaunchConfiguration config) throws CoreException {
+       
+       // Attach debugging should add the "Debug" directory to its [Shared Libraries] path.
+        List<String> values = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, new ArrayList(1));
+        ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+        IProject proj = ProjectUtil.getProject(config);
+        String appPath = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
+        if (!appPath.isEmpty()) {
+               appPath = new Path(appPath).removeLastSegments(1).toOSString();
+        } else {
+               newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
+        }
+        IConfiguration buildConfig = ProjectUtil.getDefaultConfiguration(proj);
+        String targetID = "";
+        String rootstrapPath = "";
+               try {
+                       targetID = PlatformConfigurationManager.getDefaultBuildTargetName(buildConfig);
+                       String path = SmartBuildInterface.getInstance().getRootstrapPath(targetID);
+                       rootstrapPath = SmartBuildInterface.getInstance().getPlatformRootstrapPath(path);                       
+               } catch (SBIException e) {
+                       newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
+               }
+        
+        IPath debugProjPath = new Path(rootstrapPath + File.separatorChar
+                       + "usr" + File.separatorChar
+                       + "lib" + File.separatorChar
+                       + "debug" + File.separatorChar
+                       + appPath);
+
+        if (canAddLibrarySearchPath(config, debugProjPath)) {
+            values.add(debugProjPath.toOSString());
+        }
+        
+        IPath debugBinPath = new Path(rootstrapPath + File.separatorChar
+                       + "usr" + File.separatorChar
+                       + "lib" + File.separatorChar
+                       + "debug" + File.separatorChar
+                       + "usr" + File.separatorChar
+                       + "bin");
+        
+        if (canAddLibrarySearchPath(config, debugBinPath)) {
+            values.add(debugBinPath.toOSString());
         }
+        
+        IPath debugLibPath = new Path(rootstrapPath + File.separatorChar
+                       + "usr" + File.separatorChar
+                       + "lib" + File.separatorChar
+                       + "debug" + File.separatorChar
+                       + "usr" + File.separatorChar
+                       + "lib");                       
+
+        if (canAddLibrarySearchPath(config, debugLibPath)) {
+            values.add(debugLibPath.toOSString());
+        }
+        
+        // set shared library search path
+        if (values.size() > 0) {
+            wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, values);
+        }
+        wc.doSave();
     }
     
+    protected boolean canAddLibrarySearchPath(ILaunchConfiguration config, IPath searchPath) throws CoreException {
+        List values = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_SOLIB_PATH, Collections.EMPTY_LIST);
+        Iterator it = values.iterator();
+        boolean ret = true;
+
+        while (it.hasNext()) {
+            IPath oldPath = new Path((String) it.next());
+            if (PathUtil.equalPath(oldPath, searchPath)) {
+                ret = false;
+                break;
+            }
+        }
+        return ret;
+    }
+
+    
     @Override
     protected void setConfigIfNotFromShortcut(ILaunchConfiguration config, String mode, IProgressMonitor monitor) 
                throws CoreException {
@@ -97,40 +186,61 @@ public class TizenDebianLaunchDelegateForAttach extends TizenDebianLaunchDelegat
     }
     
     @Override
-    protected void launchApplicationWithGDBServer(ILaunch launch, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException {        
+    protected void launchApplicationWithGDBServer(ILaunch launch, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException {
+       
         try {
             monitor.beginTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER, 1);
             monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBSERVER);
             
-               IPath path = getHostPath(TizenPlatformConstants.HOST_GDBSERVER_PATH, config);
-               PlatformLaunchUtils launchUtils = new PlatformLaunchUtils();                    
-               launchUtils.readyGdbServer(currentDevice, tizenCommand, path);
-
+            IPath path = getHostPath(TizenPlatformConstants.HOST_GDBSERVER_PATH, config);
+            PlatformLaunchUtils launchUtils = new PlatformLaunchUtils();
+            launchUtils.readyGdbServer(currentDevice, tizenCommand, path);
+            
             if (pid.equals(Integer.valueOf(-1)) || pid.equals(Integer.valueOf(0))) {
                 newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER + ICDTLaunchConfigurationConstants.ERR_NO_PROCESSID, null);
             }
 
-            String gdbserverPort = config.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);            
-            String commandArguments =  ":" + gdbserverPort + TizenPlatformConstants.ATTACH_OPTION + pid;
-            String gdbserverCmd = TizenPlatformConstants.GDBSERVER_PLATFORM_CMD + " " + commandArguments;
-            String envCmd = setEnvironments(config);
-            String command = envCmd + gdbserverCmd;
-            serverProc = currentDevice.executeShellCommand(command);
-               } catch (TimeoutException e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
-               } catch (SdbCommandRejectedException e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
+            String gdbserverRunCommand = getGdbserverRunCommand(config);
+            String resultCommand = null;
+
+            // is gdbserver running now ? then
+            resultCommand = String.format(TizenPlatformConstants.PROCESS_GET_PROCESS_ID_COMMAND, gdbserverRunCommand.trim());
+            tizenCommand.run(resultCommand, null);
+            if (tizenCommand.getEndLine() != null) {
+                if (StringUtil.isInteger(tizenCommand.getEndLine().trim())) {
+                    resultCommand = String.format(TizenPlatformConstants.PROCESS_SIGKILL_COMMAND, tizenCommand.getEndLine() + TizenPlatformConstants.CMD_RESULT_CHECK);
+                    try {
+                        tizenCommand.run(resultCommand, "0");
+                    } catch (CoreException e) {
+                       newCoreException(TizenLaunchMessages.GDBSERVER_ALREADY_RUNNING, null);
+                    } catch (Exception e) {                        
+                       newCoreException(TizenLaunchMessages.GDBSERVER_ALREADY_RUNNING, null);
+                    }
+                }
+            }
+            // Run gdbserver as blocking mode!
+            tizenCommand.run(gdbserverRunCommand, null, true);
         } catch (CoreException e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
-        } catch (IOException e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
+               newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
         } catch (Exception e) {
-            newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);
+               newCoreException(TizenLaunchMessages.CANNOT_LAUNCH_APPLICATION_WITH_GDBSERVER, null);            
         } finally {
             monitor.done();
         }
     }
     
+    protected String getGdbserverRunCommand(ILaunchConfiguration config) 
+               throws CoreException, Exception {        
+        
+        String gdbserverPort = config.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT);            
+        String commandArguments =  ":" + gdbserverPort + TizenPlatformConstants.ATTACH_OPTION + pid;
+        String gdbserverCmd = TizenPlatformConstants.GDBSERVER_PLATFORM_CMD + " " + commandArguments;
+        String envCmd = setEnvironments(config);
+        String command = envCmd + gdbserverCmd;
+
+        return command;
+    }  
+    
     private void setAttachProcess(ILaunchConfiguration config) throws CoreException {
        final PlatformLaunchUtils launchUtils = new PlatformLaunchUtils();
        String processName = config.getAttribute(ITizenLaunchConfigurationConstants.ATTR_PROCESSNAME_OPTION, "");
@@ -223,5 +333,14 @@ public class TizenDebianLaunchDelegateForAttach extends TizenDebianLaunchDelegat
                } catch (InterruptedException e) {
                        e.printStackTrace();
                }               
-    } 
+    }
+    
+    @Override
+    protected File getGDBClientArgument(IBinaryObject exeFile) {
+        // It should be null. If <binary_path> is passed as an gdb argument, breakpoint address is corrupted.
+        //  1) gdb
+        //  2) target remote :<port>
+        //  3) set solib-search-path <binary_path>
+        return null;
+    }
 }
\ No newline at end of file
index 4b620f5..d4cb827 100644 (file)
@@ -49,6 +49,7 @@ public class TizenDebianLaunchMessages extends NLS {
        public static String CANNOT_FIND_PACKAGE_SECTION_IN_CONTROL_FILE;
        public static String OPERATION_CANCELED;
        public static String IS_NOT_INITIALIZED_ROOTSTRAP;
+       public static String DEVICE_IS_NOT_ROOT_ON;
        // non-error messages
        public static String LAUNCH_APPLICATION;
        public static String LAUNCH_APPLICATION_WITH_GDBSERVER;
index 7ee5f3c..1427710 100644 (file)
@@ -13,6 +13,7 @@ CANNOT_FIND_DEBIAN_CONTROL_FILE = Debian control file not found.
 CANNOT_FIND_PACKAGE_SECTION_IN_CONTROL_FILE = Package section not found in the control file.
 OPERATION_CANCELED = Operation canceled.
 IS_NOT_INITIALIZED_ROOTSTRAP = Rootstrap is not initialized. [%s]
+DEVICE_IS_NOT_ROOT_ON = Device is not root on
 
 LAUNCH_APPLICATION = Launching the application...
 LAUNCH_APPLICATION_WITH_GDBSERVER = Launching the application with GDBServer...
@@ -28,4 +29,4 @@ CHECK_PKG_STATUS = Checking package status
 CANCELED_LAUNCH = Canceled launching
 QUESTION_PACKAGING = "%s" project does not have package files(*.rpm)\nDo you want packaging now ?\n
 QUESTION_CONTINUE = Do you want to continue ?
-FAILED_INSTALL_PKGS = Failed to install packages. See below logs
\ No newline at end of file
+FAILED_INSTALL_PKGS = Failed to install packages. Please check below error log.
\ No newline at end of file
index 45c524e..04fcc85 100644 (file)
@@ -174,6 +174,11 @@ public class PlatformLaunchUtils {
                
                monitor.beginTask("Installing packages to rootstrap", 3);
                
+               if (!device.isRoot()) {
+                       String msg = "Device is not root on";
+                       newException(msg);
+        }
+               
                ArrayList<LocalPackage> packagesForDevice = new ArrayList<LocalPackage>();
        ConsoleManager cm = new ConsoleManager("package manager", true);
                //cm.clear();
index 6342c37..1087ca3 100644 (file)
@@ -217,17 +217,16 @@ public class PlatformLaunchWizard extends Wizard implements IPageChangingListene
                                                        }                                                       
 
                                                        monitor.subTask(TizenDebianLaunchMessages.INSTALL_PACKAGES_TO_DEVICE);
-                                                       if (selecteDvPkgs != null && !selecteDvPkgs.isEmpty()) {
+                                                       if (selecteDvPkgs != null && !selecteDvPkgs.isEmpty()) {                                                                
                                                                launchUtil.installPkgsToDevice(selecteDvPkgs, device, new SubProgressMonitor(monitor, 1));
                                                        }
                                                        monitor.done();                                         
                                                }                                       
                                });
                        } catch (InvocationTargetException e) {
-                               // TODO Auto-generated catch block
                                e.printStackTrace();
                        } catch (InterruptedException e) {
-                               // TODO Auto-generated catch block
+                               // This exception is occurred if device is not root on or failed to install
                                e.printStackTrace();                            
                                openLogDialog(TizenDebianLaunchMessages.FAILED_INSTALL_PKGS, e.getMessage());                                           
                                cancelChanging(event);
index 28d91d3..c55ec71 100644 (file)
@@ -533,24 +533,26 @@ public class RPMPackageCommander {
                String result = rec.getLog()[0];
                int firstIndex = result.indexOf("<pkg>");
                int lastIndex = result.lastIndexOf("</pkg>");
-               result = result.substring(firstIndex, lastIndex);
-               String[] splitStr = result.split("</pkg>");
-               
-               for (String s : splitStr) {
-                       s = s.replaceAll(" ", "").replaceAll("<pkg>", "");
-                       String[] part = s.split(",");
-                       if (part.length == 3) {
-                               String name = part[0];
-                               String version = part[1];
-                               String arch = part[2];
-                               Package pkg = packageHash.get(name);
-                               if (pkg == null) {
-                                       packageHash.put(name, new Package(name, version, "", arch));
-                               } else {
-                                       pkg.setInstalledVersion(version);
+               if (firstIndex >= 0 || lastIndex >= 0 ) {
+                       result = result.substring(firstIndex, lastIndex);
+                       String[] splitStr = result.split("</pkg>");
+                       for (String s : splitStr) {
+                               s = s.replaceAll(" ", "").replaceAll("<pkg>", "");
+                               String[] part = s.split(",");
+                               if (part.length == 3) {
+                                       String name = part[0];
+                                       String version = part[1];
+                                       String arch = part[2];
+                                       Package pkg = packageHash.get(name);
+                                       if (pkg == null) {
+                                               packageHash.put(name, new Package(name, version, "", arch));
+                                       } else {
+                                               pkg.setInstalledVersion(version);
+                                       }
                                }
                        }
                }
+                               
 
                Enumeration<Package> e = packageHash.elements();
                while (e.hasMoreElements()) {
@@ -703,7 +705,7 @@ public class RPMPackageCommander {
 
        private static void actionBeforeUseZypperDevice(IDevice device) {
                if (device.isEmulator()) {
-                       PackageManagerOuputReceiver rec = getNewOuputReceiver();
+                       PackageManagerOuputReceiver rec = getNewOuputReceiverWithConsole();
                        //rec.cleanLog();
                        String command = String
                                        .format("sed -i \"s/# arch = s390/arch = i686/g\" /etc/zypp/zypp.conf");
index c487f6b..6827eff 100644 (file)
@@ -1,3 +1,12 @@
+* 2.1.5
+- applied new method that get app's installation path.
+- Changed version from tizen2.0 to tizen2.1
+- Fixed sonar violations
+- Modified initializing string in proxy url parser
+- Fixed bug for running gdbserver through sdb
+- Support platform debugging on SMACK
+- Added solib-search-path for "/usr/bin" and "/usr/lib" when attach debugging
+== donghyuk yang <donghyuk.yang@samsung.com> 2013-04-19
 * 2.1.4
 - Fixed a wrong label
 - Process architecture before creating new rootstrap
index 5b95c9e..7125be9 100644 (file)
@@ -1,4 +1,4 @@
-Version:2.1.4
+Version:2.1.5
 Source:nativeplatform-eplugin
 Maintainer:Kangho Kim <kh5325.kim@samsung.com>, Yoonki Park<yoonki.park@samsung.com>, Hyunsik Noh<hyunsik.noh@samsung.com>, Gun Kim<gune.kim@samsung.com>, Ho Namkoong<ho.namkoong@samsung.com>, Taeyoung Son<taeyoung2.son@samsung.com>