0

For example, in the CallGraphs.java file below, the doStuff1 function is not defined, so the file can not be compiled. When I use the command java -cp soot.jar soot.Main -cp .:soot.jar -pp -allow-phantom-refs -allow-phantom-elms -src-prec java CallGraphs, it throws soot.CompilationDeathException.

public class CallGraphs
{
    public static void main(String[] args) {
        doStuff1();
    }
    
    public static void doStuff() {
        new A().foo();
    }
}
 
class A
{
    public void foo() {
        bar();
    }
    
    public void bar() {
    }
}

Is there a way for soot to continue to analyse the file without throwing soot.CompilationDeathException? Moreover,if soot can not do this, is there a tool that can finish the task?

杨国强
  • 1
  • 1
  • 1
    Asking for offsite resources (other tools) is off-topic. If you change `doStuff1()` to `doStuff()` I will assume soot works, which strongly implies soot "can not do this". Best of luck with finding a tool that supports static code analysis on illegal code. – Elliott Frisch Dec 23 '22 at 14:01
  • Soot theoretically has the capability to use Java source files. But as far as I know this feature is unmaintained for years so it may work or not. In your case I would try not to store multiple classes in one Java file. – JMax Dec 27 '22 at 12:13
  • Thanks for your reply. I have found a new tool called Joern that can solve the problem. – 杨国强 Jan 01 '23 at 03:30

0 Answers0