support coredump debugging
authorkh5325.kim <kh5325.kim@samsung.com>
Tue, 12 Mar 2013 10:36:49 +0000 (19:36 +0900)
committerkh5325.kim <kh5325.kim@samsung.com>
Tue, 12 Mar 2013 10:36:49 +0000 (19:36 +0900)
org.tizen.common.connection/src/org/tizen/common/connection/ui/TizenRemoteFileDialog.java
org.tizen.common/src/org/tizen/common/TizenPlatformConstants.java

index 634f420..863cf46 100755 (executable)
@@ -25,8 +25,6 @@
 */
 package org.tizen.common.connection.ui;
 
-import java.io.IOException;
-
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.swt.SWT;
@@ -49,12 +47,9 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeColumn;
 import org.eclipse.swt.widgets.TreeItem;
-import org.tizen.common.TizenPlatformConstants;
 import org.tizen.common.connection.ConnectionPlugin;
-import org.tizen.common.util.log.Logger;
 import org.tizen.sdblib.FileListingService.FileEntry;
 import org.tizen.sdblib.IDevice;
-import org.tizen.sdblib.MultiLineReceiver;
 
 public class TizenRemoteFileDialog {
     public enum TizenRemoteFileDialogResult {
@@ -73,6 +68,7 @@ public class TizenRemoteFileDialog {
     private Tree pathTree;
     private TreeViewer pathTreeViewer;
     private Composite upper;
+    private boolean enableMultiSelection = false;
 
     TizenRemoteFileContentProvider remoteContentProvider = null;
 
@@ -106,6 +102,11 @@ public class TizenRemoteFileDialog {
         createControls(shell);
     }
 
+    public TizenRemoteFileDialog(Shell parent, String dlgTitle, IDevice device, boolean isDirOnly, String defaultPath, boolean enableMultiSelection) {
+        this(parent, dlgTitle, device, isDirOnly, defaultPath);
+        this.enableMultiSelection = enableMultiSelection;
+    }
+
     public TizenRemoteFileDialogResult open() {
         shell.open();
         runEventLoop(shell);
@@ -301,7 +302,12 @@ public class TizenRemoteFileDialog {
 
     private void createPathTree(Composite pParent) {
         // if add SWT.VIRTUAL, horizontal scrol is not shown in case of Linux
-        pathTree = new Tree(pParent, SWT.MULTI | SWT.FULL_SELECTION);
+        int style = SWT.FULL_SELECTION;
+        if (enableMultiSelection) {
+            style = style | SWT.MULTI;
+        }
+        pathTree = new Tree(pParent, style);
+
         setTreeLayout(pathTree);
     }
 
@@ -373,22 +379,11 @@ public class TizenRemoteFileDialog {
         display.update();
     }
 
-    private void setDefaultPath(final String corePath) {
-        if (corePath == null) {
-            defaultPath = "/";
-        }
-
-        String command = "ls " + TizenPlatformConstants.PRIVATE_PLATFORM_CORE_PATH + "/*/files/core.* 2&>/dev/null | wc -l";
-
-        try {
-            this.device.executeShellCommand(command, new MultiLineReceiver() {
-                @Override
-                public void processNewLines(String[] lines) {
-                    defaultPath = "0".equals(lines[0]) ? corePath : TizenPlatformConstants.PRIVATE_PLATFORM_CORE_PATH;
-                }
-            });
-        } catch (IOException e) {
-            Logger.error("Problem occurred while executing command '" + command + "'", e.getMessage(), e);
+    private void setDefaultPath(final String basePath) {
+        if (basePath == null) {
+            this.defaultPath = "/";
+        } else {
+            this.defaultPath = basePath;
         }
     }
 }
index ea0ad13..75718ce 100644 (file)
@@ -54,8 +54,11 @@ public class TizenPlatformConstants {
     public static final String PKGTYPE_DEB = "DEB";
 
     // Definitions for debugging
-    public static final String PUBICL_PLATFORM_CORE_PATH = "/opt/bs/core";
-    public static final String PRIVATE_PLATFORM_CORE_PATH = "/opt/share/hidden_storage/SLP_debug";
+    public static final String DEBUG_COREFILE_PATH;
+    public static final String DEBUG_COREFILE_EXTENSION;
+    public static final String DEBUG_COREFILE_EXTRACT_COMMAND;
+    public static final String DEBUG_COREFILE_EXTRACT_TEMP_PATH;
+
     public static final String GDBSERVER_CMD;
     public static final String GDBSERVER_PLATFORM_CMD;
     public static final String ATTACH_OPTION = " --attach ";
@@ -103,5 +106,9 @@ public class TizenPlatformConstants {
         APP_INSTALL_PATH = "/opt/apps";
         APP_ICON_INSTALL_PATH = "shared/res";
         TEMPORARY_PKG_PATH = "/opt/apps/PKGS/";
+        DEBUG_COREFILE_PATH = "/opt/usr/share/crash/dump";
+        DEBUG_COREFILE_EXTENSION = "coredump";
+        DEBUG_COREFILE_EXTRACT_COMMAND = "tar -xvf %s -C %s --wildcards --no-anchored '%s'";
+        DEBUG_COREFILE_EXTRACT_TEMP_PATH = "/tmp";
     }
 }