java.lang.jdynpur
Class Tracer

java.lang.Object
  extended by java.lang.jdynpur.Tracer

public class Tracer
extends java.lang.Object

Methods in this class are called by injected code to write trace events.
This class continously writes a trace of events into file trace.out. If a suffix file (a file named suffix_* exists, then the suffix of the filename (e.g. file name suffix_0 -> suffix = 0 -> file name = trace.out_0) is appended to the name of the outputfile.

Author:
dallmeier

Field Summary
static int EV_ARRAYCREATED
          Constant for array creation event.
static int EV_ARRAYMODIFIED
          Constant for array modification event.
static int EV_DYNAMICMETHODEND
          Constant for start of dynamic method event.
static int EV_DYNAMICMETHODSTART
          Constant for start of dynamic method event.
static int EV_FIELDID
           
static int EV_FIELDWRITE
          Constant for field write event.
static int EV_METHODID
           
static int EV_OBJECTARRAYMODIFIED
           
static int EV_OBJECTCREATION
          Constant for object creation event.
static int EV_OBJECTFIELDWRITE
           
static int EV_PARAMETER
           
static int EV_STATICFIELDWRITE
          Constant for static field write event.
static int EV_STATICMETHODEND
          Constant for end of static method end event.
static int EV_STATICMETHODSTART
          Constant for start of static method event.
static org.softevo.util.ObjectIdMapper<org.softevo.util.asm.FieldIdentifier> fieldIdentfierMap
           
static org.softevo.util.asm.MethodIdentifierMapGenerator methodIdentifierMap
           
static int NULL
          Constant for null value.
static java.lang.String OUTPUTFILENAME
          The base name for the output file.
static int STATIC
          Constant indicating access to a static variable or execution of a static method.
static boolean traceParameterMutability
           
 
Constructor Summary
Tracer()
           
 
Method Summary
static void addArraysRecursively(java.lang.Object[] array, int depth)
          This method is called to record creation of multi dimensional arrays.
static void arrayCreated(java.lang.Object object)
          Called whenever a new array was created.
static void arrayModified(java.lang.Object object)
          Called whenever an entry in an array is modified.
static void dynamicMethodEnded(int methodId)
          Called whenever a dynamic method has just finished execution.
static void dynamicMethodStarted(int methodId, java.lang.Object thisObject)
          Called whenever a dynamic method is started.
static void fieldWritten(java.lang.Object object)
          Called whenever a field is written in an object.
static void objectArrayModified(java.lang.Object array, int index, java.lang.Object value)
           
static void objectCreated(java.lang.Object object)
          Called whenever a new object is created.
static void objectFieldWritten(java.lang.Object receiver, java.lang.Object value, int fieldId)
           
static void parameterPassed(int index, java.lang.Object parameter)
           
static void staticFieldWritten()
          Called whenever a static field was written.
static void staticMethodEnded(int methodId)
          Called whenever a static method has just finished execution.
static void staticMethodStarted(int methodId)
          Called whenever a static method is started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

methodIdentifierMap

public static org.softevo.util.asm.MethodIdentifierMapGenerator methodIdentifierMap

fieldIdentfierMap

public static org.softevo.util.ObjectIdMapper<org.softevo.util.asm.FieldIdentifier> fieldIdentfierMap

OUTPUTFILENAME

public static final java.lang.String OUTPUTFILENAME
The base name for the output file.

See Also:
Constant Field Values

EV_OBJECTCREATION

public static final int EV_OBJECTCREATION
Constant for object creation event.

See Also:
Constant Field Values

EV_FIELDWRITE

public static final int EV_FIELDWRITE
Constant for field write event.

See Also:
Constant Field Values

EV_STATICFIELDWRITE

public static final int EV_STATICFIELDWRITE
Constant for static field write event.

See Also:
Constant Field Values

EV_DYNAMICMETHODSTART

public static final int EV_DYNAMICMETHODSTART
Constant for start of dynamic method event.

See Also:
Constant Field Values

EV_STATICMETHODSTART

public static final int EV_STATICMETHODSTART
Constant for start of static method event.

See Also:
Constant Field Values

EV_DYNAMICMETHODEND

public static final int EV_DYNAMICMETHODEND
Constant for start of dynamic method event.

See Also:
Constant Field Values

EV_STATICMETHODEND

public static final int EV_STATICMETHODEND
Constant for end of static method end event.

See Also:
Constant Field Values

EV_ARRAYCREATED

public static final int EV_ARRAYCREATED
Constant for array creation event.

See Also:
Constant Field Values

EV_ARRAYMODIFIED

public static final int EV_ARRAYMODIFIED
Constant for array modification event.

See Also:
Constant Field Values

EV_METHODID

public static final int EV_METHODID
See Also:
Constant Field Values

EV_PARAMETER

public static final int EV_PARAMETER
See Also:
Constant Field Values

EV_FIELDID

public static final int EV_FIELDID
See Also:
Constant Field Values

EV_OBJECTFIELDWRITE

public static final int EV_OBJECTFIELDWRITE
See Also:
Constant Field Values

EV_OBJECTARRAYMODIFIED

public static final int EV_OBJECTARRAYMODIFIED
See Also:
Constant Field Values

traceParameterMutability

public static final boolean traceParameterMutability

STATIC

public static final int STATIC
Constant indicating access to a static variable or execution of a static method.

See Also:
Constant Field Values

NULL

public static final int NULL
Constant for null value.

See Also:
Constant Field Values
Constructor Detail

Tracer

public Tracer()
Method Detail

objectFieldWritten

public static void objectFieldWritten(java.lang.Object receiver,
                                      java.lang.Object value,
                                      int fieldId)

fieldWritten

public static void fieldWritten(java.lang.Object object)
Called whenever a field is written in an object.

Parameters:
object - the modified object

objectCreated

public static void objectCreated(java.lang.Object object)
Called whenever a new object is created. This method is called after the constructor call.

Parameters:
object - the object that is created

dynamicMethodStarted

public static void dynamicMethodStarted(int methodId,
                                        java.lang.Object thisObject)
Called whenever a dynamic method is started.

Parameters:
methodId - the id of the method that is started
thisObject - the object the method is invoked on

parameterPassed

public static void parameterPassed(int index,
                                   java.lang.Object parameter)

staticMethodStarted

public static void staticMethodStarted(int methodId)
Called whenever a static method is started.

Parameters:
methodId - the id of the method that is started

dynamicMethodEnded

public static void dynamicMethodEnded(int methodId)
Called whenever a dynamic method has just finished execution.

Parameters:
methodId - the id of the method

staticMethodEnded

public static void staticMethodEnded(int methodId)
Called whenever a static method has just finished execution.

Parameters:
methodId - the id of the method

staticFieldWritten

public static void staticFieldWritten()
Called whenever a static field was written.


arrayCreated

public static void arrayCreated(java.lang.Object object)
Called whenever a new array was created.

Parameters:
object - the array created

arrayModified

public static void arrayModified(java.lang.Object object)
Called whenever an entry in an array is modified.

Parameters:
object - the array that was modified

objectArrayModified

public static void objectArrayModified(java.lang.Object array,
                                       int index,
                                       java.lang.Object value)

addArraysRecursively

public static void addArraysRecursively(java.lang.Object[] array,
                                        int depth)
This method is called to record creation of multi dimensional arrays. This is necessary because otherwise we don't know about the creation of all arrays.

Parameters:
array - the object array, possibly containing more object arrays
depth - the recursion depth


Copyright © 2007-2008 Software Engineering Group at Saarland University. All Rights Reserved.