find_file()
{
- echo $1
- echo $2
cd $1
find . -name $2
}
--- /dev/null
+#!/bin/bash
+FIND=/usr/bin/find
+RPM_COMMAND=/usr/bin/rpm2cpio
+
+print_usage()
+{
+ echo "Usage: debuginfo [options] [arguments]"
+ echo "Options:"
+ echo "-r extract rpm package"
+ echo "-f find files"
+}
+
+find_file()
+{
+ echo $1
+ echo $2
+ cd $1
+ find . -name $2
+}
+
+extract()
+{
+ echo $1
+ echo $2
+ echo $3
+ cd $1
+ rpm2cpio $2 | cpio -imd
+ rpm2cpio $3 | cpio -imd
+}
+
+if [[ -n $1 ]]; then
+ case "$1" in
+ -f)
+ if [[ "$#" -ne 3 ]]; then
+ echo "find needs two arguments!"
+ exit 1
+ fi
+ shift
+ find_file $@
+ ;;
+ -r)
+ if [[ "$#" -ne 4 ]]; then
+ echo "extract needs three arguments!"
+ exit 1
+ fi
+ shift
+ extract $@
+ ;;
+ *)
+ echo "unknown option!"
+ print_usage
+ ;;
+ esac
+else
+ print_usage
+fi
+
+
+
+++ /dev/null
-#!/bin/bash
-
-cd $1
-find . -name $2
+++ /dev/null
-#!/bin/bash
-
-echo $1
-echo $2
-echo $3
-
-cd $1
-rpm2cpio $2 | cpio -imd
-rpm2cpio $3 | cpio -imd
-
-
int percent = OpenTraceProgressManager.getInstance().getPercent();\r
if (loadInfos() && loadCallStackData() && loadCallStackApis()\r
&& loadProfilingData() && loadProfilingChildData()\r
- && loadLeakData() && loadFailedData() && loadImageSet()) {\r
+ && \r
+// loadLeakData() && \r
+// loadFailedData() && \r
+ loadImageSet()) {\r
\r
OpenTraceProgressManager.getInstance().setProgressPercent(\r
AnalyzerLabels.OPEN_TRACE_PROGRESS_LOADING, percent += 60);\r
import org.tizen.dynamicanalyzer.resources.FontResources;\r
import org.tizen.dynamicanalyzer.resources.ImageResources;\r
import org.tizen.dynamicanalyzer.swap.channel.control.BinaryInfo;\r
+import org.tizen.dynamicanalyzer.swap.channel.data.LibraryObject;\r
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfo;\r
import org.tizen.dynamicanalyzer.swap.channel.data.ProcessInfoPackage;\r
import org.tizen.dynamicanalyzer.swap.model.data.LogData;\r
tooltipShow(event.x, event.y);\r
}\r
\r
+ private String getSourcePath(GridItem item, SourceLine sourceLine) {\r
+ String filePath = null;\r
+ String libName = getLibPath(item);\r
+\r
+ if (!isLibrary(libName)) {\r
+ filePath = sourceLine.getFilePath();\r
+ } else {\r
+ BinarySettingData binData = BinarySettingManager.getInstance()\r
+ .getRealBinarySetting(libName);\r
+ filePath = binData.getSourcePath() + sourceLine.getFilePath();\r
+ }\r
+\r
+ return filePath;\r
+ }\r
+\r
private void createTooltip(Event event) {\r
GridItem item = grid.getItem(new Point(event.x, event.y));\r
if (null != item) {\r
title.setBackground(ColorResources.TOOLTIP);\r
\r
// Sets tooltip title text.\r
- String filePath = null;\r
- String libName = getLibPath(item);\r
- if (libName == null) {\r
- filePath = sl.getFilePath();\r
- } else {\r
- List<BinarySettingData> binarySettings = BinarySettingManager\r
- .getInstance().getBinarySettings();\r
- for (int i = 0; i < binarySettings.size(); i++) {\r
- if (binarySettings.get(i).isEqual(libName)) {\r
- filePath = binarySettings.get(i).getSourcePath();\r
- break;\r
- }\r
- }\r
- }\r
- if (filePath == null) {\r
- filePath = sl.getFilePath();\r
- }\r
-\r
+ String filePath = getSourcePath(item, sl);\r
int line = sl.getLineNumber();\r
title.setText(filePath + CommonConstants.SPACE\r
+ CommonConstants.SPACE + CommonConstants.NEW_LINE);\r
boolean isPieBuild = true;\r
int pid = -1;\r
long time = 0;\r
+ String libName = null;\r
\r
switch (tableData.getType()) {\r
case AnalyzerConstants.TYPE_TABLE_CALLSTACK:\r
time = data.getTime();\r
}\r
\r
+ libName = getLibPath(item);\r
+\r
ProcessInfoPackage processInfoPkg = AnalyzerManager.getProject()\r
.getProcessInfo(pid);\r
ProcessInfo processInfo = processInfoPkg.getProcessInfo(time);\r
}\r
isPieBuild = (binInfo.getType() == 1) ? true : false;\r
\r
- String baseAddr = Long.toString(AnalyzerManager.getProject()\r
- .getBaseAddress(pid, time));\r
+ // String baseAddr = Long.toString(AnalyzerManager.getProject()\r
+ // .getBaseAddress(pid, time));\r
+ String baseAddr = null;\r
String path = null;\r
+ // if (libName.equals(processInfo.getMainTargetBinaryPath())) {\r
+ if (!isLibrary(libName)) {\r
+ baseAddr = Long.toString(processInfo.getLowestAddress());\r
+ } else {\r
+ LibraryObject libObj = processInfo.getLibObjHash().get(libName);\r
+ if (null != libObj) {\r
+ baseAddr = Long.toString(libObj.getLowestAddress());\r
+ } else {\r
+ SourceLine sl = new SourceLine();\r
+ sl.setError(AnalyzerConstants.SOURCELINE_NO_SOURCELINE_DATA);\r
+ return sl;\r
+ }\r
+ }\r
+\r
BinarySettingData binData = BinarySettingManager.getInstance()\r
- .getBinarySetting(binInfo.getTargetBinaryPath());\r
+ .getRealBinarySetting(binInfo.getTargetBinaryPath());\r
if (null != binData) {\r
String debugPath = binData.getDebugFilePath();\r
if (null != debugPath && !debugPath.isEmpty()) {\r
path = debugPath;\r
} else {\r
- path = binInfo.getSourceBinaryPath();\r
+ path = binInfo.getTempBinaryPath();\r
}\r
} else {\r
- path = binInfo.getSourceBinaryPath();\r
+ path = binInfo.getTempBinaryPath();\r
}\r
SourceLine sl = SymbolManager.addr2line(path, addr, isPieBuild,\r
baseAddr);\r
}\r
\r
private void openIDE(Event event) {\r
-\r
SourceLine sl = null;\r
-\r
GridItem item = grid.getItem(new Point(event.x, event.y));\r
if (null == item) {\r
return;\r
return;\r
}\r
\r
- IDECommunicator.sendCodeInfoToIDE(sl.getFilePath(),\r
- Integer.toString(sl.getLineNumber()));\r
+ String filePath = getSourcePath(item, sl);\r
+ int lineNum = sl.getLineNumber();\r
+ IDECommunicator.sendCodeInfoToIDE(filePath, Integer.toString(lineNum));\r
}\r
\r
private String getLibPath(GridItem item) {\r
}\r
return libName;\r
}\r
+\r
+ private boolean isLibrary(String binaryPath) {\r
+ if (binaryPath.contains(".so")) {\r
+ return true;\r
+ }\r
+ return false;\r
+ }\r
}\r
this.localBinaryPath = path;
}
- public String getSourceBinaryPath() {
+ public String getTempBinaryPath() {
return this.tempBinaryPath;
}
- public void setSourceBinaryPath(String tempPath) {
+ public void setTempBinaryPath(String tempPath) {
this.tempBinaryPath = tempPath;
}
BinaryInfo mainInfo = DACommunicator.getSelectedApp()
.getMainBinaryInfo();
List<AddrSymbolPair> symbols = selectedApp.getSymbols(mainInfo
- .getSourceBinaryPath());
+ .getTempBinaryPath());
List<FunctionInst> functionInstList = appInst.getFunctionInstList();
int size = (symbols == null) ? 0 : symbols.size();
.split(CommonConstants.SLASH);
binInfo.setLocalBinaryPath(localBinaryPath);
// init source binary path
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
if (null == splitLocalBinaryPath[0]
|| splitLocalBinaryPath[0].isEmpty()) {
localBinaryPath = AnalyzerPaths.TEMP_FOLDER_PATH
+ File.separator + getFileName(targetPath);
result = pullTheFile(targetPath, localBinaryPath);
if (result.isSuccess()) {
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
}
index += ByteUtils.getStringLength(payload, index);
String md5sum = ByteUtils.getString(payload, index);
binInfo.setType(binaryType);
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
binInfo.setMd5sumValue(md5sum);
return result;
} else {
index += ByteUtils.getStringLength(payload, index);
String md5sum = ByteUtils.getString(payload, index);
binInfo.setType(binaryType);
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
binInfo.setMd5sumValue(md5sum);
}
+ File.separator + getFileName(targetPath);
result = pullTheFile(targetPath, localBinaryPath);
if (result.isSuccess()) {
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
}
return result;
}
+ File.separator + getFileName(targetPath);
result = pullTheFile(targetPath, localBinaryPath);
if (result.isSuccess()) {
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
}
return result;
}
if (null == binInfo) {
continue;
}
- String localPath = binInfo.getSourceBinaryPath();
+ String localPath = binInfo.getTempBinaryPath();
ElfSymbolExtracter symbolExtractor = new ElfSymbolExtracter();
if (!symbolExtractor.makeSymbol(localPath)) {
index += INT_SIZE;
localBinaryPath = ByteUtils.getString(payload, index).trim();
binInfo.setLocalBinaryPath(localBinaryPath);
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
String[] splitLocalBinaryPath = localBinaryPath
.split(CommonConstants.SLASH);
if (splitLocalBinaryPath.length <= 0
index += ByteUtils.getStringLength(payload, index);
String md5sum = ByteUtils.getString(payload, index);
binInfo.setType(binaryType);
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
binInfo.setMd5sumValue(md5sum);
index += ByteUtils.getStringLength(payload, index);
}
index += ByteUtils.getStringLength(payload, index);
String md5sum = ByteUtils.getString(payload, index);
binInfo.setType(binaryType);
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
binInfo.setMd5sumValue(md5sum);
index += ByteUtils.getStringLength(payload, index);
}
+ File.separator + getFileName(binPaths.get(i));
result = pullTheFile(binPaths.get(i), localBinaryPath);
if (result.isSuccess()) {
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
}
continue;
}
+ File.separator + getFileName(binPaths.get(i));
result = pullTheFile(binPaths.get(i), localBinaryPath);
if (result.isSuccess()) {
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
}
continue;
} else {
- binInfo.setSourceBinaryPath(localBinaryPath);
+ binInfo.setTempBinaryPath(localBinaryPath);
}
}
BinarySettingManager.getInstance().addBinaryInfos(binInfoList);
public class BinarySettingManager {
private static BinarySettingManager instance = null;
- private List<BinarySettingData> binarySettings = new ArrayList<BinarySettingData>();
private HashMap<String, BinaryInfo> targetBinInfoMap = new HashMap<String, BinaryInfo>();
private HashMap<String, BinaryInfo> localBinInfoMap = new HashMap<String, BinaryInfo>();
}
}
- public List<BinarySettingData> getBinarySettings() {
- return binarySettings;
- }
-
- public void clearData() {
- binarySettings.clear();
- }
-
public void putRealBinarySettingData(List<BinarySettingData> data) {
for (BinarySettingData binData : data) {
for (int i = 0; i < realBinarySettings.size(); i++) {
}
}
- // extract rpm file
+ // extract rpm file exists
if (null != debugRpmPath) {
String toolPath = AnalyzerPaths.TOOL_FOLDER_PATH
- + File.separator + "rpm_extractor.sh";
- String[] command = new String[] { toolPath, rpmPath,
+ + File.separator + "debuginfo.sh";
+ String[] command = new String[] { toolPath, "-r", rpmPath,
debugRpmPath, debugRpmSourcePath };
try {
Runtime rt = Runtime.getRuntime();
new InputStreamReader(
process.getErrorStream()));
String errorStr = error.readLine();
- System.out.println("host md5sum get failed : "
+ System.out.println("debug info file extract failed... : "
+ errorStr);
continue;
}
String libVersion = libPostFix
.substring(4, libPostFix.length());
String debugCmd = AnalyzerPaths.TOOL_FOLDER_PATH
- + File.separator + "find.sh " + rpmPath + " " + "*"
- + libPostFix + ".debug";
+ + File.separator + "debuginfo.sh -f " + rpmPath + " "
+ + "*" + libPostFix + ".debug";
String debugFilePath = null;
try {
Runtime rt = Runtime.getRuntime();
BufferedReader error = new BufferedReader(
new InputStreamReader(process.getErrorStream()));
String errorStr = error.readLine();
- System.out.println("host md5sum get failed : "
+ System.out.println("debug source file extract failed... : "
+ errorStr);
continue;
}
// check real source file path
String sourceFilePath = null;
String sourceCmd = AnalyzerPaths.TOOL_FOLDER_PATH
- + File.separator + "find.sh " + rpmPath + " " + "*"
- + libVersion;
+ + File.separator + "debuginfo.sh -f " + rpmPath + " "
+ + "*" + libVersion;
try {
Runtime rt = Runtime.getRuntime();
Process process = rt.exec(sourceCmd);
+ errorStr);
continue;
}
- sourceFilePath = rpmPath + line.substring(1, line.length());
+ sourceFilePath = rpmPath;
System.out.println("SOURCE PATH : " + sourceFilePath);
} catch (IOException e) {
e.printStackTrace();
return localBinInfoMap;
}
- public BinarySettingData getBinarySetting(String targetBinaryPath) {
- List<BinarySettingData> binaries = getBinarySettings();
+ public BinarySettingData getRealBinarySetting(String targetBinaryPath) {
+ List<BinarySettingData> binaries = getRealBinarySettings();
int size = binaries.size();
BinarySettingData binData = null;
return removeBinarySettings;
}
- public void syncData() {
- realBinarySettings.clear();
- realBinarySettings.addAll(binarySettings);
- }
}
import java.util.ArrayList;
import java.util.List;
-import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
String pcStr = Long.toString(pcAddr);
BinaryInfo binInfo = DACommunicator.getSelectedApp()
.getMainBinaryInfo();
- String localPath = binInfo.getSourceBinaryPath();
+ String localPath = binInfo.getTempBinaryPath();
boolean isPieBuild = true;
if (binInfo.getType() != 1) {
isPieBuild = false;
String path = libraryObject.getLibPath();
BinaryInfo binInfo = binInfoMap.get(path);
if (null != binInfo) {
- String localPath = binInfo.getSourceBinaryPath();
+ String localPath = binInfo.getTempBinaryPath();
String baseAddr = Long.toString(libraryObject
.getLowestAddress());
String pcStr = Long.toString(pcAddr);
if (null != input && !input.isEmpty()) {
logs.setLogs(input);
logPackage.setLogs(id, logs);
+ for (LogData log : input) {
+ if (id == DataChannelConstants.MSG_PROBE_FILE
+ || id == DataChannelConstants.MSG_PROBE_MEMORY) {
+ AnalyzerManager.getLeakDetector()
+ .runLeakDectect(log);
+ }
+
+ AnalyzerManager.getFailedChecker().check(log);
+ }
}
} // for
break;
String localBinPath = AnalyzerUtil.getProcessLocalBinaryPath(pid, time);
String key = getTargetPathKey(localBinPath);
BinaryInfo binInfo = DACommunicator.getSelectedApp().getBinaryInfo(key);
- String sourceBinPath = binInfo.getSourceBinaryPath();
+ String sourceBinPath = binInfo.getTempBinaryPath();
return sourceBinPath;
}
String pcStr = Long.toString(pcAddr);
BinaryInfo binInfo = DACommunicator.getSelectedApp()
.getMainBinaryInfo();
- String localPath = binInfo.getSourceBinaryPath();
+ String localPath = binInfo.getTempBinaryPath();
input.setBuildType(binInfo.getType());
input.setBinaryPath(binInfo.getTargetBinaryPath());
boolean isPieBuild = true;
String path = libraryObject.getLibPath();
BinaryInfo binInfo = binInfoMap.get(path);
if (null != binInfo) {
- String localPath = binInfo.getSourceBinaryPath();
+ String localPath = binInfo.getTempBinaryPath();
String baseAddr = Long.toString(libraryObject
.getLowestAddress());
String pcStr = Long.toString(pcAddr);