Package daikon.dcomp

Class Premain


  • public class Premain
    extends Object
    This class is the entry point for the DynComp instrumentation agent. It is the only code in dcomp_premain.jar.
    • Field Detail

      • debug_dcinstrument

        public static boolean debug_dcinstrument
        Turn on basic DCInstrument debugging options.
      • debug_dcruntime

        public static boolean debug_dcruntime
        Turn on basic DCRuntime debugging options.
      • debug_dcruntime_all

        public static boolean debug_dcruntime_all
        Turn on most DCRuntime debugging options.
      • verbose

        public static boolean verbose
        If true, print information about the classes being transformed.
      • problem_classes

        protected static Set<String> problem_classes
        Set of classes known to cause problems when instrumented.
      • problem_methods

        protected static Set<String> problem_methods
        Set of methods known to cause problems when instrumented.
      • in_shutdown

        protected static boolean in_shutdown
        One of the last phases for DynComp is to write out the comparability values after the user program completes execution. One of the steps is to assign values to the arguments of methods that have not been executed. We use reflection to get type information about these arguments, which causes the method to be loaded; which causes the main part of DynComp to try to instrument the method. As the user program has completed execution, doing instrumentation at this point can lead to problems. The correct fix for this problem is to use BCEL to get the type information instead of reflection, thus avoiding loading the method into the JVM. This will be a large change, so a temporary fix is to indicate if the program is in shutdown mode and not instrument any methods when this flag is true. TODO: Couldn't we just call removeTransformer at the start of shutdown?
    • Constructor Detail

    • Method Detail

      • premain

        public static void premain​(String agentArgs,
                                   Instrumentation inst)
                            throws IOException
        This method is the entry point of the Java agent. Its main purpose is to set up the transformer so that when classes from the target app are loaded, they are first transformed in order to add comparability instrumentation.
        Parameters:
        agentArgs - string containing the arguments passed to this agent
        inst - instrumentation instance to be used to transform classes
        Throws:
        IOException - if jdk_classes.txt cannot be read or if the correct version of BCEL cannot be found or loaded
      • open

        public static PrintWriter open​(File filename)
        Helper method to create a PrintWriter from a File.
        Parameters:
        filename - the File to be opened
        Returns:
        a new PrintWriter from filename