daikon
Class Chicory

Object
  extended by Chicory

public class Chicory
extends Object

This is the main class for Chicory which transforms the class files of a program to instrument it for Daikon. The instrumentation uses the javaagent switch to java (which allows classes to be instrumented as they are loaded). This class parses the command line arguments, starts java with the javaagent switch on the target program and if requested starts Daikon on the result.


Field Summary
static Pattern boot_classes
           
static boolean checkStaticInit
          flag to use if we want to turn on the static initialization checks
static File comparability_file
           
static File config_dir
           
static boolean daikon
           
static String daikon_args
          Specifies Daikon arguments to be used if Daikon is run on a generated trace file or online via a socket.
static boolean daikon_online
           
static Process daikon_proc
          daikon process for --daikon switch
static boolean debug
           
static boolean debug_ppt_names
           
static boolean debug_transform
           
static boolean default_bcel
           
static File dtrace_file
           
static StreamRedirectThread err_thread
          Thread that copies stderr from target to our stderr
static String heap_size
           
static boolean linked_lists
           
static int nesting_depth
           
static boolean new_decl_format
           
static Pattern omit_var
           
static StreamRedirectThread out_thread
          Thread that copies output from target to our output
static File output_dir
           
static List<Pattern> ppt_omit_pattern
           
static List<Pattern> ppt_select_pattern
           
static File premain
          Path to java agent jar file that performs the transformation.
static File purity_file
          The name of the file to read for a list of pure methods.
static int sample_start
           
static long start
          starting time (msecs)
static boolean std_visibility
           
static String synopsis
          Synopsis for the chicory command line
static boolean verbose
           
 
Constructor Summary
Chicory()
           
 
Method Summary
 String args_to_string(List<String> args)
          convert a list of arguments into a command line string
static boolean check_args(Options options, String[] target_args)
          Check the resulting arguments for legality.
static boolean doPurity()
          Return true iff argument was given to run a purity analysis Only run after running parse_args
static long elapsed_msecs()
           
static String elapsed()
          Returns elapsed time as a String since the start of the program
static File get_purity_file()
          Return true iff a file name was specified to supply pure method names
static void main(String[] args)
          Entry point of Chicory
 PrintWriter openFileInDirectory(String fileName, String dirName)
           
 String[] parseDaikonArgs(String arg)
           
 int redirect_wait(Process p)
          Wait for stream redirect threads to complete and return its exit status
 void runDaikon()
          Runs daikon either online or on the generated trace file.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dtrace_file

public static File dtrace_file

omit_var

public static Pattern omit_var

output_dir

public static File output_dir

nesting_depth

public static int nesting_depth

ppt_omit_pattern

public static List<Pattern> ppt_omit_pattern

ppt_select_pattern

public static List<Pattern> ppt_select_pattern

comparability_file

public static File comparability_file

verbose

public static boolean verbose

std_visibility

public static boolean std_visibility

debug

public static boolean debug

debug_transform

public static boolean debug_transform

boot_classes

public static Pattern boot_classes

heap_size

public static String heap_size

debug_ppt_names

public static boolean debug_ppt_names

new_decl_format

public static boolean new_decl_format

default_bcel

public static boolean default_bcel

premain

public static File premain
Path to java agent jar file that performs the transformation. The "main" procedure is ChicoryPremain.premain().

See Also:
ChicoryPremain.premain(java.lang.String, java.lang.instrument.Instrumentation)

purity_file

public static File purity_file
The name of the file to read for a list of pure methods. Should be 1 method per line. Each method should be in the same format as format ouput by the purity analysis.


config_dir

public static File config_dir

daikon

public static boolean daikon

daikon_online

public static boolean daikon_online

daikon_args

public static String daikon_args
Specifies Daikon arguments to be used if Daikon is run on a generated trace file or online via a socket. If neither --daikon or --daikon-online is chosen, this option will select --daikon


linked_lists

public static boolean linked_lists

sample_start

public static int sample_start

out_thread

public static StreamRedirectThread out_thread
Thread that copies output from target to our output


err_thread

public static StreamRedirectThread err_thread
Thread that copies stderr from target to our stderr


start

public static long start
starting time (msecs)


daikon_proc

public static Process daikon_proc
daikon process for --daikon switch


checkStaticInit

public static final boolean checkStaticInit
flag to use if we want to turn on the static initialization checks

See Also:
Constant Field Values

synopsis

public static final String synopsis
Synopsis for the chicory command line

See Also:
Constant Field Values
Constructor Detail

Chicory

public Chicory()
Method Detail

main

public static void main(String[] args)
Entry point of Chicory

Parameters:
args - see usage for argument descriptions

check_args

public static boolean check_args(Options options,
                                 String[] target_args)
Check the resulting arguments for legality. Prints a messagen and Returns false if there was an error


doPurity

public static boolean doPurity()
Return true iff argument was given to run a purity analysis Only run after running parse_args


get_purity_file

public static File get_purity_file()
Return true iff a file name was specified to supply pure method names


runDaikon

public void runDaikon()
Runs daikon either online or on the generated trace file.


redirect_wait

public int redirect_wait(Process p)
Wait for stream redirect threads to complete and return its exit status


openFileInDirectory

public PrintWriter openFileInDirectory(String fileName,
                                       String dirName)

elapsed

public static String elapsed()
Returns elapsed time as a String since the start of the program


elapsed_msecs

public static long elapsed_msecs()

args_to_string

public String args_to_string(List<String> args)
convert a list of arguments into a command line string


parseDaikonArgs

public String[] parseDaikonArgs(String arg)