萌新最近搬砖遇到一个问题,上面让我做一个dump文件的自动解析系统,至于解析的工具,准备用的是google的breakpad,项目部署环境是linux+jdk1.8。其他的无关紧要也就不谈了。
一开始写了一个demo放到测试机上面跑,最初代码如下(只保留转换相关的代码,所以不可以运行):
import java.io.InputStreamReader;
public class DumpAnalyseUtil {
public static boolean analyseDumpFile(String stackPath, String dumpPath, String symPath, String logPath){
boolean result = false;
Process process = null;
File stackFile = new File(stackPath);
File dumpFile = new File(dumpPath);
File symbolFile = new File(symPath);
File logFile = new File(logPath);
try{
if (stackFile.exists() && dumpFile.exists() && symbolFile.exists()){
String command = stackPath + " " + dumpPath + " " + symPath + " > " + logPath;
System.out.println(