From 2637b57480b922d79cbfc1bfc7b4d372154b7723 Mon Sep 17 00:00:00 2001 From: "yoonki.park" Date: Thu, 7 Mar 2013 18:59:13 +0900 Subject: [PATCH] support coredump debugging Change-Id: Id86c69f82e1cc4fbe7098411b6d4bcee1ac08d1d Signed-off-by: yoonki.park --- .../connection/ui/TizenRemoteFileDialog.java | 39 ++++++++++------------ .../org/tizen/common/TizenPlatformConstants.java | 12 +++++-- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/org.tizen.common.connection/src/org/tizen/common/connection/ui/TizenRemoteFileDialog.java b/org.tizen.common.connection/src/org/tizen/common/connection/ui/TizenRemoteFileDialog.java index 634f420..863cf46 100755 --- a/org.tizen.common.connection/src/org/tizen/common/connection/ui/TizenRemoteFileDialog.java +++ b/org.tizen.common.connection/src/org/tizen/common/connection/ui/TizenRemoteFileDialog.java @@ -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; } } } diff --git a/org.tizen.common/src/org/tizen/common/TizenPlatformConstants.java b/org.tizen.common/src/org/tizen/common/TizenPlatformConstants.java index ea0ad13..1561093 100644 --- a/org.tizen.common/src/org/tizen/common/TizenPlatformConstants.java +++ b/org.tizen.common/src/org/tizen/common/TizenPlatformConstants.java @@ -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,10 @@ 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"; + } } -- 2.7.4