[Soot-list] Inline JavaDeps

John Jorgensen jorgnsn at lcd.uregina.ca
Fri Apr 14 16:33:07 EDT 2006


>>>>> "dth.forum" == The Hung Dao <dth.forum at gmail.com> writes:
    dth.forum>  I inline JavaDeps with command:
    dth.forum> java soot.Main --app -w -debug-resolver -process-dir "C:\JavaDeps" -src-prec
    dth.forum> java -main-class smr/JavaDeps/JavaDeps -p jb off -p jj off -p cg
    dth.forum> verbose:true,jdkver:4,trim-clinit:false -p cg.cha on -p wstp off -p wsop off
    dth.forum> -p wjtp off -p wjop.smb off -p wjop.si enabled:false,expansion-factor:5 -p
    dth.forum> wjap off -p shimple off -p stp off -p sop off -p jtp off -p jop off -p jap
    dth.forum> off -p gb off -p gop off -p bb off -p bop off -p tag off
    ---> error:
    dth.forum> bringing to HIERARCHY: smr.JavaDeps.ASCII_UCodeESC_CharStream
    dth.forum> Exception in thread "main" java.lang.RuntimeException: couldn't find class:
    dth.forum> smr.JavaDeps.ASCII_UCodeESC_CharStream (is your soot-class-path set
    dth.forum> properly?)

The following modification of your command line executes without
error (though there are several suggestions from the call graph
builder to add "-p cg safe-forname:true,safe-newinstance:true" if
you want a more conservative call graph):

java -mx412m -classpath /nobackup/soot/trunk/classes:/nobackup/jasmin/trunk/classes:/nobackup/soot/polyglot.jar:/nobackup/soot/jedd-runtime.jar soot.Main \
  --app -w -debug-resolver \
  -process-dir ../JavaDeps-1.0.4/jdeps.jar \
  -soot-class-path ../JavaDeps-1.0.4/jdeps.jar:/usr/local/pkgs/jdk1.5.0_06/jre/lib/jce.jar:/usr/local/pkgs/jdk1.5.0_06/jre/lib/rt.jar \
  -main-class smr.JavaDeps.JavaDeps \
  -p cg verbose:true,jdkver:4,trim-clinit:false -p cg.cha on \
  -p wstp off -p wsop off -p wjtp off -p wjop.smb off \
  -p wjop.si enabled:false,expansion-factor:5 -p wjap off \
  -p shimple off -p stp off -p sop off -p jtp off -p jop off \
  -p jap off -p gb off -p gop off -p bb off -p bop off -p tag off

Aside from the fact that the paths reflect the location of things
on my Linux machine instead of on your Windows machine, the changes
are:

 - I removed "-src-prec java" and set the class path to analyze
   the classes in the jar file which comes with JavaDeps instead
   of the source files.  This addresses two issues:

     First, the source for smr.JavaDeps.ASCII_UCodeESC_CharStream
     is not included in the JavaDeps package, but is supposed to
     be generated by javacc.  But even if you run javacc, it
     won't generate that file unless you use a release of
     javacc older than 2.1 (see
     https://javacc.dev.java.net/doc/javaccreleasenotes.html).
     By just analyzing the class files in jdeps.jar (which
     includes ASCII_UCodeESC_CharStream) I sidestepped the issue
     of making JavaDeps compatible with current releases of JavaCC.

     I'm not sure whether the Java-to-Jimple apparatus requires
     the source directories to reflect package names
     (i.e. expecting JavaDep.java to be in src/JavaDep).  Again,
     using the class files instead of the java files for input
     let me ignore that issue.

 - I replaced "-main-class smr/JavaDeps/JavaDeps" with
   "-main-class smr.JavaDeps.JavaDeps".  You might not need to do
   that on windows, where '/' is not the path separator.

 - I removed "-p jb off -p jj off".  "jb" and "jj" are the initial
   phases which create Soot's internal representation of the
   program from either class files (jb) or java source files (jj).  If
   you turn them both off, you're essentially denying Soot any
   input to analyze.

It occurs to me that some of the other phases which you switched
off might be important for proper inlining, but I didn't look
into that issue.

-- 
John Jorgensen	LCD System Administrator  jorgnsn at lcd.uregina.ca
                                          306.337.2344



More information about the Soot-list mailing list