Patrice Pominville
patrice@sable.mcgill.ca
March 8, 2000
Soot can be invoked in the following ways:
soot [option]* [classname]+
soot -app [option]* classname
When given one or several classnames that refers to a Java type, and no -app option, soot will attempt to resolve it by finding a file containing the given type. Once soot has located such a file, it will read in its contents, perform transformations on its bytecode and output the type in a specified output format. This mode of operation is referred to as running soot in single-file mode. All types specified on the commandline are resolved and processed. In this mode, the last file specified on the command-line serves as the main class, when such a notion is needed.
The -app argument can be used to activate soot's application mode. In application mode soot will perform a transitive closure on the types listed in the constant pool of the type provided on the command line. soot will then proceed to transform the types in this closure. The closure will contain Java library types, as well as types particular to the application. By default, only the application-specific types will be processed by soot. This can be overridden by command line options. Clearly, in this case, the file specified on the command-line is the main class.
To resolve a type, soot uses the same semantics as the java command; soot looks for files containing types in the directories specified by the SOOT_CLASSPATH environment variable. This variable serves the same purpose as java's CLASSPATH environment variable. There is also a command line option to override the SOOT_CLASSPATH variable. If there is no Soot classpath, then the external Java CLASSPATH is used. (There is a note for Windows users in the section describing the soot-class-path entry).
Once a type has been resolved and read into soot, various transformations can be applied to its code. These are described in the optimization section of the options below.
The Soot framework has 3 different internal representations: Baf, Jimple and Grimp. soot allows one to output a processed class either as a standard classfile or in the textual format corresponding to one of the above internal representations. Thus a class can be outputted as a .baf file, a .jimple file or a .grimple file that will contain textual representations for the Baf , Jimple and Grimp internal representations respectively. Additionally a processed type can be outputed in the Jasmin assembler format, as a .jasmin file.
These are only valid if soot is invoked in application mode by specifying the -app command line argument.
[-final-rep baf] When producing .baf, .jasmin or .class output, produce the output using Soot's Baf internal representation. See [VRGH$^+$00] for details on this topic. [-t, -time] Print out time statistics about transformations. [-subtract-gc] Attempt to subtract garbage-collection time from the time stats. [-v, -verbose] Verbose mode. [-debug] Avoid catching exceptions and print debug information. [-p, -phase-option PHASE-NAME KEY:VALUE] Set run-time option KEY to VALUE for PHASE-NAME (default for VALUE is true). This option is quite powerful; it is documented in phase options.
Invokes soot in application mode for the type MyApp. All types to be resolved should be found in the working directory's classes subdirectory or /localhome/plam/JDKlib. Types will be resolved from .class files; if this fails, .jimple files will be considered. Only the application's classes will be processed; scalar optimizations will be applied to these. The transformed types will be outputted in Jimple's textual representation as .jimple files.
Invokes soot in single-file mode for the type MyApp. Tries to resolve MyApp (and all other classes) from a .jimple file before looking for a .class file. Looks for the type in the directories specified by the SOOT_CLASS_PATH environment variable. Outputs the type as a classfile, using the Baf internal representation to construct the bytecode.
March 11, 2000: Added note for Windows users.
This document was generated using the LaTeX2HTML translator Version 99.2beta6 (1.42)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html usage -split 0 -nonavigation -dir foo
The translation was initiated by Patrick LAM on 2000-03-24