Package daikon.dcomp
Class Premain
- Object
-
- Premain
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Premain.ShutdownThread
Shutdown thread that writes out the comparability results.
-
Field Summary
Fields Modifier and Type Field Description static boolean
debug_dcinstrument
Turn on basic DCInstrument debugging options.static boolean
debug_dcruntime
Turn on basic DCRuntime debugging options.static boolean
debug_dcruntime_all
Turn on most DCRuntime debugging options.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.protected static Set<String>
pre_instrumented
Set of pre-instrumented JDK classes.protected static Set<String>
problem_classes
Set of classes known to cause problems when instrumented.protected static Set<String>
problem_methods
Set of methods known to cause problems when instrumented.protected static Set<String>
problem_packages
Set of packages known to cause problems when instrumented.static boolean
verbose
If true, print information about the classes being transformed.
-
Constructor Summary
Constructors Constructor Description Premain()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PrintWriter
open(File filename)
Helper method to create a PrintWriter from a File.static void
premain(String agentArgs, Instrumentation inst)
This method is the entry point of the Java agent.
-
-
-
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.
-
pre_instrumented
protected static Set<String> pre_instrumented
Set of pre-instrumented JDK classes.
-
problem_packages
protected static Set<String> problem_packages
Set of packages known to cause problems when instrumented.
-
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
-
Premain
public Premain()
-
-
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 agentinst
- 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
-
-