Package daikon

Class DynComp


  • public class DynComp
    extends Object
    This is the main class for DynComp. It uses the -javaagent switch to Java (which allows classes to be instrumented as they are loaded). This class parses the command line arguments and starts Java with the -javaagent switch on the target program. Code based largely on daikon.Chicory.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean abridged_vars
      Causes DynComp to abridge the variable names printed.
      static @MonotonicNonNull File comparability_file
      Output filename for a more easily human-readable file summarizing comparability sets.
      static String daikonPath
      Holds the path to "daikon.jar" or to "daikon/java:daikon/java/lib/*".
      static boolean debug
      Output debugging information.
      static boolean debug_decl_print
      Print detailed information on variables being observed.
      static File debug_dir
      The directory in which to dump instrumented class files.
      static boolean debug_transform
      Print detailed information on which classes are transformed.
      static @MonotonicNonNull String decl_file
      Output filename for .decls file suitable for input to Daikon.
      static boolean dump
      Dump the instrumented classes to disk, for diagnostic purposes.
      static boolean help
      Display usage information.
      static int nesting_depth
      Depth to which to examine structure components.
      static boolean no_jdk
      Do not use the instrumented JDK.
      static File output_dir
      The directory in which to create output files (i.e., Daikon input files).
      static List<Pattern> ppt_omit_pattern
      Suppress program points that match regex.
      static List<Pattern> ppt_select_pattern
      Only emit program points that match regex.
      static @Nullable File premain
      Path to Java agent .jar file that performs the transformation.
      static @Nullable File rt_file
      Specifies the location of the instrumented JDK.
      static long start
      starting time (msecs)
      static boolean std_visibility
      Causes DynComp to traverse exactly those fields visible from a given program point.
      static String synopsis
      Synopsis for the DynComp command line.
      static @MonotonicNonNull File trace_file
      If specified, write a human-readable file showing some of the interactions that occurred.
      static int trace_line_depth
      Controls size of the stack displayed in tracing the interactions that occurred.
      static boolean verbose
      Print information about the classes being transformed.
    • Constructor Summary

      Constructors 
      Constructor Description
      DynComp()  
    • Field Detail

      • help

        public static boolean help
        Display usage information.
      • verbose

        public static boolean verbose
        Print information about the classes being transformed.
      • dump

        public static boolean dump
        Dump the instrumented classes to disk, for diagnostic purposes. The directory is specified by --debug-dir (default debug).
      • debug

        public static boolean debug
        Output debugging information.
      • debug_dir

        public static File debug_dir
        The directory in which to dump instrumented class files.
      • output_dir

        public static File output_dir
        The directory in which to create output files (i.e., Daikon input files).
      • decl_file

        public static @MonotonicNonNull String decl_file
        Output filename for .decls file suitable for input to Daikon.
      • comparability_file

        public static @MonotonicNonNull File comparability_file
        Output filename for a more easily human-readable file summarizing comparability sets.
      • trace_file

        public static @MonotonicNonNull File trace_file
        If specified, write a human-readable file showing some of the interactions that occurred.
      • trace_line_depth

        public static int trace_line_depth
        Controls size of the stack displayed in tracing the interactions that occurred. Used in daikon.dcomp.TagEntry.
      • abridged_vars

        public static boolean abridged_vars
        Causes DynComp to abridge the variable names printed.
      • rt_file

        public static @Nullable File rt_file
        Specifies the location of the instrumented JDK.
      • std_visibility

        public static boolean std_visibility
        Causes DynComp to traverse exactly those fields visible from a given program point.
      • nesting_depth

        public static int nesting_depth
        Depth to which to examine structure components.
      • daikonPath

        public static String daikonPath
        Holds the path to "daikon.jar" or to "daikon/java:daikon/java/lib/*".
      • debug_transform

        public static boolean debug_transform
        Print detailed information on which classes are transformed.
      • debug_decl_print

        public static boolean debug_decl_print
        Print detailed information on variables being observed.
      • no_jdk

        public static boolean no_jdk
        Do not use the instrumented JDK.
      • start

        public static long start
        starting time (msecs)
    • Constructor Detail

    • Method Detail

      • main

        public static void main​(String[] args)
        Entry point of DynComp.
        Parameters:
        args - see usage for argument descriptions
      • check_args

        public static void check_args​(Options options,
                                      String[] targetArgs)
        Check the command-line arguments for legality. Prints a message and exits if there was an error.
        Parameters:
        options - set of legal options to DynComp
        targetArgs - arguments being passed to the target program
      • redirect_wait

        public int redirect_wait​(Process p)
        Wait for stream redirect threads to complete.
      • elapsed

        public static String elapsed()
        Returns elapsed time since the start of the program.
        Returns:
        elapsed time since the start of the program
      • elapsedMsecs

        public static long elapsedMsecs()
        Returns number of milliseconds since the start of the program.
        Returns:
        number of milliseconds since the start of the program
      • argsToString

        public String argsToString​(List<String> args)
        Convert a list of arguments into a command-line string. Only used for debugging output.
        Parameters:
        args - the list of arguments
        Returns:
        argument string
      • locateFile

        @RequiresNonNull("cp")
        public @Nullable File locateFile​(String fileName)
        Search for a file on the current classpath, then in ${DAIKONDIR}/java. Returns null if not found.
        Parameters:
        fileName - the relative name of a file to look for
        Returns:
        path to fileName or null
      • findOnClasspath

        @RequiresNonNull("cp")
        public @Nullable File findOnClasspath​(String fileName)
        Search for a file on the current classpath. Returns null if not found.
        Parameters:
        fileName - the relative name of a file to look for
        Returns:
        path to fileName or null