From 4387fefabdb293106cb287decdcaf0c634dc569f Mon Sep 17 00:00:00 2001 From: jooyoul_lee Date: Thu, 3 Oct 2013 10:56:56 +0900 Subject: [PATCH] [Title] remove comments, minor bug fix [Desc.] [Issue] --- .../ApplicationWorkbenchWindowAdvisor.java | 2 - .../communicator/BaseCommunicator.java | 4 +- .../communicator/Communicator22.java | 4 +- .../communicator/DACommunicator.java | 58 ++++---- .../communicator/IDECommunicator.java | 6 +- .../tizen/dynamicanalyzer/model/DeviceInfo.java | 14 +- .../project/{AppInfo.java => PackageInfo.java} | 4 +- .../org/tizen/dynamicanalyzer/project/Project.java | 4 +- .../swap/callstack/BaseCallstackManager.java | 6 +- .../swap/communicator/Communicator30.java | 162 ++++++++++----------- .../swap/model/probe2/LogDataFactory.java | 4 - .../ui/info/callstack/CallStackUnit.java | 4 +- .../dynamicanalyzer/ui/toolbar/ToolbarArea.java | 44 +++--- 13 files changed, 151 insertions(+), 165 deletions(-) rename org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/{AppInfo.java => PackageInfo.java} (98%) diff --git a/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java b/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java index c6ef4b6..e974954 100755 --- a/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java +++ b/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java @@ -42,7 +42,6 @@ import org.tizen.dynamicanalyzer.common.DASingletonFocusManager; import org.tizen.dynamicanalyzer.common.PathManager; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.communicator.IDECommunicator; -import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.handlers.ExitHandler; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; import org.tizen.dynamicanalyzer.ui.toolbar.configuration.ConfigurationDialogValues; @@ -118,7 +117,6 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { public boolean preWindowShellClose() { if (DACommunicator.isRunning()) { -// DACommunicator.sendStopMessage(); DACommunicator.stopTrace(); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/BaseCommunicator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/BaseCommunicator.java index f3d53a6..3f6761f 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/BaseCommunicator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/BaseCommunicator.java @@ -5,7 +5,7 @@ import java.net.Socket; import org.tizen.dynamicanalyzer.common.HostResult; import org.tizen.dynamicanalyzer.model.DeviceInfo; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; public abstract class BaseCommunicator { @@ -43,6 +43,6 @@ public abstract class BaseCommunicator { public abstract void closeSock(); - public void setSelectedApp(AppInfo app) { + public void setSelectedApp(PackageInfo app) { } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/Communicator22.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/Communicator22.java index 24527eb..baec065 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/Communicator22.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/Communicator22.java @@ -18,7 +18,7 @@ import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.common.HostResult; import org.tizen.dynamicanalyzer.logparser.LogParser; import org.tizen.dynamicanalyzer.model.DeviceInfo; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.swap.model.control.EventObject; import org.tizen.dynamicanalyzer.swap.model.control.ReplayEvent; import org.tizen.dynamicanalyzer.ui.file.FileChartManager; @@ -159,7 +159,7 @@ public class Communicator22 extends BaseCommunicator { + CommonConstants.CMD_SPLIT + ConfigureManager.getInstance().getConfiguration() + CommonConstants.CMD_SPLIT - + DACommunicator.getSelectedApp().getInfo(AppInfo.EXEC_INDEX); + + DACommunicator.getSelectedApp().getInfo(PackageInfo.EXEC_INDEX); String message = AnalyzerConstants.MSG_START + CommonConstants.CMD_SPLIT + rearMessage.length() diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java index ca37a43..8c0443f 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java @@ -21,7 +21,7 @@ import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.common.HostResult; import org.tizen.dynamicanalyzer.common.PathManager; import org.tizen.dynamicanalyzer.model.DeviceInfo; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.swap.communicator.Communicator30; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool; @@ -46,7 +46,7 @@ public class DACommunicator { private static List packageInfoMultiLines = new ArrayList(); - private static AppInfo selectedApp = null; + private static PackageInfo selectedApp = null; private static List devices = null; private static DeviceInfo currentDevice = null; @@ -150,11 +150,11 @@ public class DACommunicator { // } } - public static AppInfo getSelectedApp() { + public static PackageInfo getSelectedApp() { return selectedApp; } - public static void setSelectedApp(AppInfo app) { + public static void setSelectedApp(PackageInfo app) { selectedApp = app; if (null != app && null != communicator) { communicator.setSelectedApp(app); @@ -272,13 +272,13 @@ public class DACommunicator { return devNameList; } - public static List getAppListFromTarget() { + public static List getAppListFromTarget() { if (null == currentDevice) { return null; } - List appInfoList = currentDevice.getAppInfoList(); - HashMap appInfoHash = currentDevice.getAppInfoHash(); - List backList = new ArrayList(); + List appInfoList = currentDevice.getAppInfoList(); + HashMap appInfoHash = currentDevice.getAppInfoHash(); + List backList = new ArrayList(); backList.addAll(appInfoHash.values()); packageInfoMultiLines.clear(); @@ -302,19 +302,19 @@ public class DACommunicator { String line = packageInfoMultiLines.get(i); if (line.contains("Appid")) { List lines = new ArrayList(); - for (int ii = 0; ii < AppInfo.PKGINFO_SIZE; ii++) { + for (int ii = 0; ii < PackageInfo.PKGINFO_SIZE; ii++) { lines.add(packageInfoMultiLines.get(ii + i)); } - AppInfo pkgInfo = makePackageInfo(lines); + PackageInfo pkgInfo = makePackageInfo(lines); if (null != pkgInfo - && pkgInfo.getInfo(AppInfo.APPTYPE_INDEX).contains( - AppInfo.APPTYPE_CPP) - && pkgInfo.getInfo(AppInfo.MULTIPLE_INDEX).equals( - AppInfo.FLAG_ZERO) - && pkgInfo.getInfo(AppInfo.NODISPLAY_INDEX).equals( - AppInfo.FLAG_ZERO)) { - String pkgId = pkgInfo.getInfo(AppInfo.PACKAGE_INDEX); - String appId = pkgInfo.getInfo(AppInfo.APPID_INDEX); + && pkgInfo.getInfo(PackageInfo.APPTYPE_INDEX).contains( + PackageInfo.APPTYPE_CPP) + && pkgInfo.getInfo(PackageInfo.MULTIPLE_INDEX).equals( + PackageInfo.FLAG_ZERO) + && pkgInfo.getInfo(PackageInfo.NODISPLAY_INDEX).equals( + PackageInfo.FLAG_ZERO)) { + String pkgId = pkgInfo.getInfo(PackageInfo.PACKAGE_INDEX); + String appId = pkgInfo.getInfo(PackageInfo.APPID_INDEX); if (null == appInfoHash.get(pkgId)) { if (!isUnittest(pkgId) && !isIME(appId)) { @@ -325,11 +325,11 @@ public class DACommunicator { backList.remove(appInfoHash.get(pkgId)); } } - i += AppInfo.PKGINFO_SIZE - 1; + i += PackageInfo.PKGINFO_SIZE - 1; } } if (!backList.isEmpty()) { - for (AppInfo pkg : backList) { + for (PackageInfo pkg : backList) { appInfoList.remove(pkg); appInfoHash.remove(pkg); } @@ -429,9 +429,9 @@ public class DACommunicator { } } - private static AppInfo makePackageInfo(List lines) { - AppInfo pkgInfo = new AppInfo(); - for (int i = 0; i < AppInfo.PKGINFO_SIZE; i++) { + private static PackageInfo makePackageInfo(List lines) { + PackageInfo pkgInfo = new PackageInfo(); + for (int i = 0; i < PackageInfo.PKGINFO_SIZE; i++) { String line = lines.get(i); int index = line.indexOf(":"); String data = line.substring(index + 1, line.length()).trim(); @@ -440,12 +440,12 @@ public class DACommunicator { return pkgInfo; } - public static AppInfo getPkgInfoByName(String appLabel) { + public static PackageInfo getPkgInfoByName(String appLabel) { if (null != currentDevice) { int size = currentDevice.getAppInfoList().size(); for (int i = 0; i < size; i++) { - AppInfo pkgInfo = currentDevice.getAppInfoList().get(i); - if (pkgInfo.getInfo(AppInfo.LABEL_INDEX).equals(appLabel)) { + PackageInfo pkgInfo = currentDevice.getAppInfoList().get(i); + if (pkgInfo.getInfo(PackageInfo.LABEL_INDEX).equals(appLabel)) { return pkgInfo; } } @@ -453,12 +453,12 @@ public class DACommunicator { return null; } - public static AppInfo getPkgInfoByAppPkgId(String pkgid) { + public static PackageInfo getPkgInfoByAppPkgId(String pkgid) { if (null != currentDevice) { int size = currentDevice.getAppInfoList().size(); for (int i = 0; i < size; i++) { - AppInfo ai = currentDevice.getAppInfoList().get(i); - if (ai.getInfo(AppInfo.PACKAGE_INDEX).equals(pkgid)) { + PackageInfo ai = currentDevice.getAppInfoList().get(i); + if (ai.getInfo(PackageInfo.PACKAGE_INDEX).equals(pkgid)) { return ai; } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java index 3633fc6..76b28f9 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/IDECommunicator.java @@ -51,7 +51,7 @@ import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.common.DASingletonFocusManager; import org.tizen.dynamicanalyzer.model.DeviceInfo; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.resources.ImageResources; import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; import org.tizen.dynamicanalyzer.ui.widgets.DADialog; @@ -280,7 +280,7 @@ public class IDECommunicator implements Runnable { DACommunicator.setSelectedDevice(device); DACommunicator.getAppListFromTarget(); - AppInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(appid); + PackageInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(appid); if (null == appInfo) { Display.getDefault().syncExec(new Runnable() { public void run() { @@ -300,7 +300,7 @@ public class IDECommunicator implements Runnable { System.out.println("invalid application name :" + appid); return; } - final String appLabel = appInfo.getInfo(AppInfo.LABEL_INDEX); + final String appLabel = appInfo.getInfo(PackageInfo.LABEL_INDEX); System.out.println("IDE recv - deviceName: " + deviceName + " appName : " + appLabel); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/DeviceInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/DeviceInfo.java index 6bbda77..ef76884 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/DeviceInfo.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/model/DeviceInfo.java @@ -6,7 +6,7 @@ import java.util.HashMap; import java.util.List; import org.tizen.dynamicanalyzer.communicator.CommunicatorUtils; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.swap.model.control.TargetInfo; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; import org.tizen.sdblib.IDevice; @@ -16,8 +16,8 @@ public class DeviceInfo { private String selectedApplication; private String targetVersion = null; - private List appInfoList = null; - private HashMap appInfoHash = null; + private List appInfoList = null; + private HashMap appInfoHash = null; private List apiList = null; private TargetInfo targetInfo = null; @@ -29,8 +29,8 @@ public class DeviceInfo { public DeviceInfo(IDevice device) { this.device = device; - appInfoList = new ArrayList(); - appInfoHash = new HashMap(); + appInfoList = new ArrayList(); + appInfoHash = new HashMap(); targetInfo = new TargetInfo(); apiList = AnalyzerUtil.getApiMap(device); } @@ -47,11 +47,11 @@ public class DeviceInfo { return device; } - public List getAppInfoList() { + public List getAppInfoList() { return appInfoList; } - public HashMap getAppInfoHash() { + public HashMap getAppInfoHash() { return appInfoHash; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppInfo.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/PackageInfo.java similarity index 98% rename from org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppInfo.java rename to org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/PackageInfo.java index dd4a795..a32ae53 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/AppInfo.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/PackageInfo.java @@ -35,7 +35,7 @@ import org.tizen.dynamicanalyzer.model.AddrSymbolPair; import org.tizen.dynamicanalyzer.swap.model.control.ApplicationInfo; import org.tizen.dynamicanalyzer.swap.model.control.BinaryInfo; -public class AppInfo { +public class PackageInfo { public static final int APPID_INDEX = 0; public static final int PACKAGE_INDEX = 1; @@ -72,7 +72,7 @@ public class AppInfo { private List appInfo = new ArrayList(); - public AppInfo() { + public PackageInfo() { for (int i = 0; i < PKGINFO_SIZE; i++) { appInfo.add(CommonConstants.EMPTY); } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java index 2c6e814..0b42c18 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/project/Project.java @@ -203,8 +203,8 @@ public class Project { } public void init() { - appName = DACommunicator.getSelectedApp().getInfo(AppInfo.LABEL_INDEX); - pkgId = DACommunicator.getSelectedApp().getInfo(AppInfo.PACKAGE_INDEX); + appName = DACommunicator.getSelectedApp().getInfo(PackageInfo.LABEL_INDEX); + pkgId = DACommunicator.getSelectedApp().getInfo(PackageInfo.PACKAGE_INDEX); DeviceInfo deviceName = DACommunicator.getSelectedDevice(); if (null != deviceName && null != deviceName.getIDevice().getSerialNumber() diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/BaseCallstackManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/BaseCallstackManager.java index b60be4e..73ca813 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/BaseCallstackManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/BaseCallstackManager.java @@ -8,7 +8,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.logparser.LogCenterConstants; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData; import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit; @@ -79,10 +79,10 @@ public abstract class BaseCallstackManager { if (userFunctionBin == null || userFunctionBin.isEmpty()) { if (AnalyzerManager.isOsp()) { userFunctionBin = new String(DACommunicator.getSelectedApp() - .getInfo(AppInfo.EXEC_INDEX) + ".exe"); //$NON-NLS-1$ + .getInfo(PackageInfo.EXEC_INDEX) + ".exe"); //$NON-NLS-1$ } else { userFunctionBin = new String(DACommunicator.getSelectedApp() - .getInfo(AppInfo.EXEC_INDEX)); + .getInfo(PackageInfo.EXEC_INDEX)); } } return userFunctionBin; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java index e655466..6577ee7 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java @@ -48,7 +48,6 @@ import java.util.List; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.common.AnalyzerManager; -import org.tizen.dynamicanalyzer.common.AnalyzerPaths; import org.tizen.dynamicanalyzer.common.AnalyzerShellCommands; import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.common.ErrorCode; @@ -59,7 +58,7 @@ import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.model.AddrSymbolPair; import org.tizen.dynamicanalyzer.model.DeviceInfo; import org.tizen.dynamicanalyzer.nl.ConfigureLabels; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.swap.logparser.SWAPLogParser; import org.tizen.dynamicanalyzer.swap.model.ByteUtils; import org.tizen.dynamicanalyzer.swap.model.control.ApplicationInfo; @@ -78,10 +77,7 @@ import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea; import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager; import org.tizen.dynamicanalyzer.uirecorder.UIRecorderTool; import org.tizen.dynamicanalyzer.utils.UpdateViewTimer; -import org.tizen.sdblib.exception.SdbCommandRejectedException; -import org.tizen.sdblib.exception.TimeoutException; import org.tizen.sdblib.receiver.MultiLineReceiver; -import org.tizen.sdblib.service.SyncResult; public class Communicator30 extends BaseCommunicator { private boolean isInit = false; @@ -186,30 +182,26 @@ public class Communicator30 extends BaseCommunicator { @Override public HostResult startTrace() { - // HostResult hr = sendBinaryInfoMessage(); - // if (!hr.isSuccess()) { - // System.out.println("binary info get failed :" + hr.getMessage()); - // } - // binary info message send DACommunicator.setRunning(true); ApplicationInfo appInfo = new ApplicationInfo(); - AppInfo selectedApp = DACommunicator.getSelectedApp(); - String appType = selectedApp.getInfo(AppInfo.APPTYPE_INDEX); - if (appType.contains(AppInfo.APPTYPE_CPP)) { + PackageInfo selectedApp = DACommunicator.getSelectedApp(); + String appType = selectedApp.getInfo(PackageInfo.APPTYPE_INDEX); + if (appType.contains(PackageInfo.APPTYPE_CPP)) { appInfo.setAppType(ApplicationInfo.APPTYPE_TIZEN); } else { appInfo.setAppType(ApplicationInfo.APPTYPE_COMMON_EXEC); } - appInfo.setAppId(selectedApp.getInfo(AppInfo.APPID_INDEX)); - appInfo.setExecPath(selectedApp.getInfo(AppInfo.EXEC_INDEX) + ".exe"); + appInfo.setAppId(selectedApp.getInfo(PackageInfo.APPID_INDEX)); + appInfo.setExecPath(selectedApp.getInfo(PackageInfo.EXEC_INDEX) + + ".exe"); RunTimeConfiguration rt = new RunTimeConfiguration(); rt.setFeatures(ConfigureManager.getInstance().getConfiguration()); byte[] replayData = AnalyzerManager.getProject().getReplayEvent(); + UserSpaceInst userSpaceInst = getUserSpaceInst(appInfo); byte[] rear = ByteUtils.getByte(appInfo.getByteValue(), - rt.getByteValue(), getUserSpaceInst().getByteValue(), - replayData); + rt.getByteValue(), userSpaceInst.getByteValue(), replayData); int length = rear.length; byte[] ret = ByteUtils.getByte(AnalyzerConstants.MSG_START_SWAP, @@ -250,7 +242,7 @@ public class Communicator30 extends BaseCommunicator { return result; } - private UserSpaceInst getUserSpaceInst() { + private UserSpaceInst getUserSpaceInst(ApplicationInfo appInfo) { UserSpaceInst output = new UserSpaceInst(); if (0 == ConfigureManager.getInstance().getValueInt( ConfigureLabels.FEATURE_FUNCTION_PROFILING)) { @@ -260,9 +252,9 @@ public class Communicator30 extends BaseCommunicator { output.setCount(1); // single processing ApplicationInst appInst = new ApplicationInst(); appInst.setApplicationType(ApplicationInfo.APPTYPE_TIZEN); - AppInfo selectedApp = DACommunicator.getSelectedApp(); - appInst.setApplicationId(selectedApp.getInfo(AppInfo.APPID_INDEX)); - appInst.setExecutablePath(selectedApp.getInfo(AppInfo.EXEC_INDEX)); + PackageInfo selectedApp = DACommunicator.getSelectedApp(); + appInst.setApplicationId(appInfo.getAppId()); + appInst.setExecutablePath(appInfo.getExecPath()); List symbols = selectedApp.getSymbols(); List functionInstList = appInst.getFunctionInstList(); @@ -286,19 +278,19 @@ public class Communicator30 extends BaseCommunicator { return output; } - public HostResult sendBinaryInfoMessage(AppInfo selectedApp) { + public HostResult sendBinaryInfoMessage(PackageInfo selectedApp) { // send config message byte[] msgBinInfo = ByteUtils .toBytes(AnalyzerConstants.MSG_BINARY_INFO); ApplicationInfo appInfo = new ApplicationInfo(); - String appType = selectedApp.getInfo(AppInfo.APPTYPE_INDEX); - if (appType.contains(AppInfo.APPTYPE_CPP)) { + String appType = selectedApp.getInfo(PackageInfo.APPTYPE_INDEX); + if (appType.contains(PackageInfo.APPTYPE_CPP)) { appInfo.setAppType(ApplicationInfo.APPTYPE_TIZEN); } else { appInfo.setAppType(ApplicationInfo.APPTYPE_COMMON_EXEC); } - appInfo.setAppId(selectedApp.getInfo(AppInfo.APPID_INDEX)); - appInfo.setExecPath(selectedApp.getInfo(AppInfo.EXEC_INDEX)); + appInfo.setAppId(selectedApp.getInfo(PackageInfo.APPID_INDEX)); + appInfo.setExecPath(selectedApp.getInfo(PackageInfo.EXEC_INDEX)); int length = appInfo.getByteValue().length; byte[] msg = ByteUtils.getByte(msgBinInfo, length, @@ -317,7 +309,7 @@ public class Communicator30 extends BaseCommunicator { selectedApp.setBinInfo(binInfo); int binaryType = ByteUtils.toInt(payload, 0); - String targetPath = selectedApp.getInfo(AppInfo.EXEC_INDEX); + String targetPath = selectedApp.getInfo(PackageInfo.EXEC_INDEX); if (appInfo.getAppType() == ApplicationInfo.APPTYPE_TIZEN) { targetPath += CommonConstants.EXTENSION_EXEC_FILE; } @@ -339,31 +331,31 @@ public class Communicator30 extends BaseCommunicator { // change binary file path of host File binFile = new File(binaryPath); if (!binFile.exists()) { - binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator - + selectedApp.getExecFileName(appInfo.getAppType()); - try { - DACommunicator.getSelectedDevice().getIDevice() - .becomeSuperUser(true); - } catch (TimeoutException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (SdbCommandRejectedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - SyncResult res = CommunicatorUtils.pull(targetPath, binaryPath); - if (null != res && res.isOk()) { - System.out.println("binary copy success!!");//$NON-NLS-1$ - } else { - System.out.println("Failed to get " + targetPath); //$NON-NLS-1$ - return HostResult.ERR_BIN_INFO_GET_FAIL; - } - binInfo.setPath(binaryPath); - return result; + // binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator + // + selectedApp.getExecFileName(appInfo.getAppType()); + // try { + // DACommunicator.getSelectedDevice().getIDevice() + // .becomeSuperUser(true); + // } catch (TimeoutException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (SdbCommandRejectedException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // + // SyncResult res = CommunicatorUtils.pull(targetPath, binaryPath); + // if (null != res && res.isOk()) { + // System.out.println("binary copy success!!");//$NON-NLS-1$ + // } else { + // System.out.println("Failed to get " + targetPath); //$NON-NLS-1$ + // return HostResult.ERR_BIN_INFO_GET_FAIL; + // } + // binInfo.setPath(binaryPath); + // return result; } // host has binary then compare binary hash target and local @@ -416,34 +408,35 @@ public class Communicator30 extends BaseCommunicator { // FIXME: permission denied problem if (!targetHashCode.equals(localHashCode)) { -// String destFilePath = AnalyzerPaths.TEMP_FOLDER_PATH -// + File.separator -// + selectedApp.getExecFileName(appInfo.getAppType()); -// try { -// DACommunicator.getSelectedDevice().getIDevice() -// .becomeSuperUser(true); -// } catch (TimeoutException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (SdbCommandRejectedException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// -// SyncResult res = CommunicatorUtils.pull(targetPath, destFilePath); -// if (null != res && res.isOk()) { -// System.out.println("binary copy success!!");//$NON-NLS-1$ -// } else { -// System.out.println("Failed to get " + targetPath + " step 2"); //$NON-NLS-1$ -// return HostResult.ERR_BIN_INFO_GET_FAIL; -// } -// String[] splitName = binaryPath.split(CommonConstants.SLASH); -// binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator -// + new String(splitName[splitName.length - 1]); -// binInfo.setPath(binaryPath); + // String destFilePath = AnalyzerPaths.TEMP_FOLDER_PATH + // + File.separator + // + selectedApp.getExecFileName(appInfo.getAppType()); + // try { + // DACommunicator.getSelectedDevice().getIDevice() + // .becomeSuperUser(true); + // } catch (TimeoutException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (SdbCommandRejectedException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // + // SyncResult res = CommunicatorUtils.pull(targetPath, + // destFilePath); + // if (null != res && res.isOk()) { + // System.out.println("binary copy success!!");//$NON-NLS-1$ + // } else { + // System.out.println("Failed to get " + targetPath + " step 2"); //$NON-NLS-1$ + // return HostResult.ERR_BIN_INFO_GET_FAIL; + // } + // String[] splitName = binaryPath.split(CommonConstants.SLASH); + // binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator + // + new String(splitName[splitName.length - 1]); + // binInfo.setPath(binaryPath); } binInfo.setPath(binaryPath); @@ -456,10 +449,9 @@ public class Communicator30 extends BaseCommunicator { byte[] config = ByteUtils.toBytes(AnalyzerConstants.MSG_CONFIG); RunTimeConfiguration rt = new RunTimeConfiguration(); rt.setFeatures(ConfigureManager.getInstance().getConfiguration()); - int length = rt.getByteValue().length; - byte[] msg = ByteUtils.concatByteArray(config, length, - rt.getByteValue()); - // TODO : send swap inst message + byte[] rtByte = rt.getByteValue(); + int length = rtByte.length; + byte[] msg = ByteUtils.concatByteArray(config, length, rtByte); HostResult result = handleControlMessage( DACommunicator.getSelectedDevice(), msg); @@ -807,7 +799,7 @@ public class Communicator30 extends BaseCommunicator { } @Override - public void setSelectedApp(AppInfo app) { + public void setSelectedApp(PackageInfo app) { HostResult hr = sendBinaryInfoMessage(app); if (!hr.isSuccess()) { System.out.println("binary info get failed :" + hr.getMessage()); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogDataFactory.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogDataFactory.java index 70a5711..3e98a3b 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogDataFactory.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogDataFactory.java @@ -255,10 +255,6 @@ public class LogDataFactory { // system log output = new SystemData(); break; -// case MSG_DATA_RECORD: -// // replay log -// output = new ReplayData(); -// break; case MSG_CONTEXT_SWITCH_ENTRY: case MSG_CONTEXT_SWITCH_EXIT: output = new ContextSwitchData(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallStackUnit.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallStackUnit.java index d0e9188..233de2c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallStackUnit.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/info/callstack/CallStackUnit.java @@ -32,7 +32,7 @@ import org.tizen.dynamicanalyzer.common.CommonConstants; import org.tizen.dynamicanalyzer.common.SymbolManager; import org.tizen.dynamicanalyzer.communicator.DACommunicator; import org.tizen.dynamicanalyzer.nl.InformationViewLabels; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler; public class CallStackUnit { @@ -86,7 +86,7 @@ public class CallStackUnit { } else { if (DACommunicator.isDeviceConnected() && path.equals(DACommunicator.getSelectedApp().getInfo( - AppInfo.EXEC_INDEX)) && AnalyzerManager.isOsp()) { + PackageInfo.EXEC_INDEX)) && AnalyzerManager.isOsp()) { path += ".exe"; //$NON-NLS-1$ } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java index 61a367e..891725a 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java @@ -54,7 +54,7 @@ import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler; import org.tizen.dynamicanalyzer.model.DeviceInfo; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; import org.tizen.dynamicanalyzer.nl.ConfigureLabels; -import org.tizen.dynamicanalyzer.project.AppInfo; +import org.tizen.dynamicanalyzer.project.PackageInfo; import org.tizen.dynamicanalyzer.project.Project; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; @@ -87,7 +87,7 @@ public class ToolbarArea { public static final int SETTING_BUTTON = 6; String selectedDevice = null; - AppInfo selectedApp = null; + PackageInfo selectedApp = null; private Shell shell; private static ToolbarArea coolbarArea; @@ -132,11 +132,11 @@ public class ToolbarArea { this.selectedDevice = selectedDevice; } - public AppInfo getSelectedApp() { + public PackageInfo getSelectedApp() { return selectedApp; } - public void setSelectedApp(AppInfo selectedApp) { + public void setSelectedApp(PackageInfo selectedApp) { this.selectedApp = selectedApp; } @@ -287,14 +287,14 @@ public class ToolbarArea { public void selectionEvent(DACustomCombo combo) { String appName = combo.getText(); if (null != appName && !appName.isEmpty()) { - AppInfo selectedApp = DACommunicator + PackageInfo selectedApp = DACommunicator .getPkgInfoByName(appName); if (null != selectedApp) { DACommunicator.setSelectedApp(selectedApp); setSelectedApp(selectedApp); DACommunicator.getSelectedDevice().setSelectedAppName( - selectedApp.getInfo(AppInfo.LABEL_INDEX)); + selectedApp.getInfo(PackageInfo.LABEL_INDEX)); } if (null != DACommunicator.getSelectedDevice()) { @@ -313,7 +313,7 @@ public class ToolbarArea { @Override public void handleEvent(Event event) { if (!appCombo.isChildShellOpened()) { - List apps = DACommunicator.getAppListFromTarget(); + List apps = DACommunicator.getAppListFromTarget(); if (null == apps || apps.isEmpty()) { return; } @@ -321,7 +321,7 @@ public class ToolbarArea { appCombo.initCombo(); int size = apps.size(); for (int i = 0; i < size; i++) { - appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX)); + appCombo.add(apps.get(i).getInfo(PackageInfo.LABEL_INDEX)); } appCombo.setText(selectedApp); } @@ -767,14 +767,14 @@ public class ToolbarArea { appCombo.setEnabled(true); appCombo.initCombo(); - List apps = DACommunicator.getAppListFromTarget(); + List apps = DACommunicator.getAppListFromTarget(); int size = 0; if (null != apps) { size = apps.size(); } for (int i = 0; i < size; i++) { - appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX)); + appCombo.add(apps.get(i).getInfo(PackageInfo.LABEL_INDEX)); } if (size > 0) { String appName = DACommunicator.getSelectedDevice() @@ -784,15 +784,15 @@ public class ToolbarArea { setSelectedApp(apps.get(0)); DACommunicator.setSelectedApp(apps.get(0)); DACommunicator.getSelectedDevice().setSelectedAppName( - apps.get(0).getInfo(AppInfo.LABEL_INDEX)); + apps.get(0).getInfo(PackageInfo.LABEL_INDEX)); } else { - AppInfo appInfo = DACommunicator.getPkgInfoByName(appName); + PackageInfo appInfo = DACommunicator.getPkgInfoByName(appName); if (null != appInfo) { appCombo.setText(appName); setSelectedApp(appInfo); DACommunicator.setSelectedApp(appInfo); DACommunicator.getSelectedDevice().setSelectedAppName( - appInfo.getInfo(AppInfo.LABEL_INDEX)); + appInfo.getInfo(PackageInfo.LABEL_INDEX)); startButton.setButtonEnabled(true); } else { appCombo.setText(appName); @@ -861,11 +861,11 @@ public class ToolbarArea { appCombo.add(items.get(i)); } appCombo.select(COMBO_FIRST_INDEX); - AppInfo appInfo = DACommunicator.getPkgInfoByName(items.get(0)); + PackageInfo appInfo = DACommunicator.getPkgInfoByName(items.get(0)); if (null != appInfo) { DACommunicator.setSelectedApp(appInfo); DACommunicator.getSelectedDevice().setSelectedAppName( - appInfo.getInfo(AppInfo.LABEL_INDEX)); + appInfo.getInfo(PackageInfo.LABEL_INDEX)); appCombo.setToolTipText(appCombo.getItem(0)); startButton.setButtonEnabled(true); } else { @@ -877,11 +877,11 @@ public class ToolbarArea { } public void setAppComboText(final String text) { - AppInfo appInfo = DACommunicator.getPkgInfoByName(text); + PackageInfo appInfo = DACommunicator.getPkgInfoByName(text); if (null != appInfo) { DACommunicator.setSelectedApp(appInfo); DACommunicator.getSelectedDevice().setSelectedAppName( - appInfo.getInfo(AppInfo.LABEL_INDEX)); + appInfo.getInfo(PackageInfo.LABEL_INDEX)); Display.getDefault().syncExec(new Runnable() { @Override public void run() { @@ -892,12 +892,12 @@ public class ToolbarArea { } public void setAppComboTextByAppId(String id) { - AppInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(id); + PackageInfo appInfo = DACommunicator.getPkgInfoByAppPkgId(id); if (null != appInfo) { DACommunicator.setSelectedApp(appInfo); DACommunicator.getSelectedDevice().setSelectedAppName( - appInfo.getInfo(AppInfo.LABEL_INDEX)); - appCombo.setText(appInfo.getInfo(AppInfo.LABEL_INDEX)); + appInfo.getInfo(PackageInfo.LABEL_INDEX)); + appCombo.setText(appInfo.getInfo(PackageInfo.LABEL_INDEX)); } } @@ -1086,7 +1086,7 @@ public class ToolbarArea { return false; } - List apps = DACommunicator.getAppListFromTarget(); + List apps = DACommunicator.getAppListFromTarget(); if (null == apps || apps.isEmpty()) { return false; } @@ -1094,7 +1094,7 @@ public class ToolbarArea { appCombo.initCombo(); size = apps.size(); for (int i = 0; i < size; i++) { - appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX)); + appCombo.add(apps.get(i).getInfo(PackageInfo.LABEL_INDEX)); } index = appCombo.getItems().indexOf(selectedApp); if (index >= 0) { -- 2.7.4