예제 #1
0
  public static Process run(String[] args) throws IOException {
    try {
      validateCommandLine(args);
      String classpath = args[CLASSPATH_INDEX];
      AnalysisScope scope =
          AnalysisScopeReader.makeJavaBinaryAnalysisScope(
              classpath, (new FileProvider()).getFile(CallGraphTestUtil.REGRESSION_EXCLUSIONS));

      // invoke WALA to build a class hierarchy
      ClassHierarchy cha = ClassHierarchy.make(scope);

      Graph<IClass> g = typeHierarchy2Graph(cha);

      g = pruneForAppLoader(g);
      String dotFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + DOT_FILE;
      String pdfFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDF_FILE;
      String dotExe = p.getProperty(WalaExamplesProperties.DOT_EXE);
      String gvExe = p.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
      DotUtil.dotify(g, null, dotFile, pdfFile, dotExe);
      return PDFViewUtil.launchPDFView(pdfFile, gvExe);

    } catch (WalaException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return null;
    }
  }
예제 #2
0
  public static <T> File writeDotFile(
      Graph<T> g, NodeDecorator labels, String title, String dotfile) {
    File f = null;

    try {
      f = DotUtil.writeDotFile(g, labels, title, dotfile);
    } catch (WalaException e) {
      e.printStackTrace();
    }

    return f;
  }