0

here is the command I use on WIndows 10 command shell :

java 
-cp .\soot-2.5.0.jar soot.Main 
-cp ".;R:\...\OCLRuler\lib;C:\...\jdk1.8.0_144\bin" 
-pp -process-dir R:\...\OCLRuler\src\  
-src-prec java 
-d R:\...\test\soot 
-allow-phantom-refs 
-main-class OCLRuler

When I execute it, I get the following output:

Soot started on Tue Sep 26 13:28:32 EDT 2017
Warning: java.dyn.InvokeDynamic is a phantom class!
Warning: Main is a phantom class!
Warning: MainMulti is a phantom class!
Warning: oclruler.a_test.MainRawTesting is a phantom class!
... all of them (100+ lines)...
Warning: oclruler.utils.ToolBox is a phantom class!
OCLRuler.java: Class "oclruler.genetics.EvaluatorOCL" not found.
OCLRuler.java: Class "oclruler.genetics.EvaluatorOCL" not found.
Exception in thread "main" soot.CompilationDeathException: Could not compile
        at soot.javaToJimple.JavaToJimple.compile(JavaToJimple.java:104)
        at soot.javaToJimple.InitialResolver.formAst(InitialResolver.java:117)
        at soot.JavaClassSource.resolve(JavaClassSource.java:54)
        at soot.SootResolver.bringToHierarchy(SootResolver.java:215)
        at soot.SootResolver.bringToSignatures(SootResolver.java:239)
        at soot.SootResolver.processResolveWorklist(SootResolver.java:154)
        at soot.SootResolver.resolveClass(SootResolver.java:124)
        at soot.Scene.loadClass(Scene.java:448)
        at soot.Scene.loadClassAndSupport(Scene.java:433)
        at soot.Scene.loadNecessaryClasses(Scene.java:1076)
        at soot.Main.run(Main.java:167)
        at soot.Main.main(Main.java:141)

All libs used in the OCLRUler project are included in OCLRUler/lib and all sources in OCLRuler/src. The output directory is not included in the soot directory. Also, the project does compile (I'm working on and with it). The . directory contains all soot/jasmin/heros jars.

Still, all classes are considered phantoms, and Soot compilation abords because (I guess) it lacks bodies from these classes. I mean that "EvaluatorOCL" (i.e., still guessing, the source of the CompilationDeathException) is a "Phantom class".

What's wrong ?

SHould I add all and every packages in Soot's classpath ?

I've tried all sorts of command line expressions - until I got profundly lost. Anybody has a clue on the matter ?

Thanks a lot. Edouard

2 Answers2

0

Changed the -pp -process-dir R:\...\OCLRuler\src\ argument for -pp -process-dir R:\...\OCLRuler\

and it seems to work fine... The phantoms are still strolling around, but there are result files in the output folder!

[edit:] Oups, this is gona become a new question... The ouput files are... EMPTY !!! As I said, there are still warnings about phantoms and outputs are generated for all files (java and class alike)

Why are they empty ?? [/edit]

0

This might well be a problem with Soot's source-code frontend, which is heavily outdated by now. I would recommend compiling the .java files to .class and then giving those to Soot.

Eric
  • 1,343
  • 1
  • 11
  • 19
  • Thanks Eric. But using the bin folder (containing class files), together with `-src-prec class` I get a `RuntTimeException : Could not load CLassfile: oclruler.genetics.Oracle` Which is an existing and compiled file – Edouard Batot Oct 03 '17 at 17:04
  • THe project I aim at analysing is in java 8. – Edouard Batot Oct 03 '17 at 17:14