Пример #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
 static {
   try {
     p = WalaProperties.loadProperties();
     p.putAll(WalaExamplesProperties.loadProperties());
   } catch (WalaException e) {
     e.printStackTrace();
     Assertions.UNREACHABLE();
   }
 }
Пример #3
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;
  }
Пример #4
0
  /**
   * @param args
   * @throws CancelException
   * @throws IllegalArgumentException
   * @throws IOException
   */
  public static void main(String[] args)
      throws IllegalArgumentException, CancelException, IOException {
    try {
      Properties p = new Properties();
      p.putAll(WalaProperties.loadProperties());
    } catch (WalaException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }

    runTestCase(TestConstants.JLEX_MAIN, TestConstants.JLEX, "JLex");
    // runTestCase(TestConstants.HELLO_MAIN, TestConstants.HELLO, "Hello");

  }