Search in sources :

Example 1 with BytecodeAnalyzer

use of org.evosuite.graphs.cfg.BytecodeAnalyzer in project evosuite by EvoSuite.

the class BooleanTestabilityTransformation method generateCDG.

private void generateCDG(MethodNode mn) {
    if (BytecodeInstructionPool.getInstance(classLoader).hasMethod(className, mn.name + mn.desc))
        return;
    BytecodeInstructionPool.getInstance(classLoader).registerMethodNode(mn, className, mn.name + // TODO: Adapt for multiple classLoaders
    mn.desc);
    BytecodeAnalyzer bytecodeAnalyzer = new BytecodeAnalyzer();
    logger.info("Generating initial CFG for method " + mn.name);
    try {
        bytecodeAnalyzer.analyze(classLoader, className, mn.name + mn.desc, // TODO
        mn);
    } catch (AnalyzerException e) {
        logger.error("Analyzer exception while analyzing " + className + "." + mn.name + ": " + e);
        e.printStackTrace();
    }
    // compute Raw and ActualCFG and put both into GraphPool
    bytecodeAnalyzer.retrieveCFGGenerator().registerCFGs();
}
Also used : BytecodeAnalyzer(org.evosuite.graphs.cfg.BytecodeAnalyzer) AnalyzerException(org.objectweb.asm.tree.analysis.AnalyzerException)

Aggregations

BytecodeAnalyzer (org.evosuite.graphs.cfg.BytecodeAnalyzer)1 AnalyzerException (org.objectweb.asm.tree.analysis.AnalyzerException)1