org.objectweb.jac.aspects.tracing
Class Debugger

java.lang.Object
  |
  +--org.objectweb.jac.aspects.tracing.Debugger

public class Debugger
extends Object

This class is a simple debugger that can by used by a program to step the called methods and print some informations.

It is used by the debugging wrapper.

See Also:
DebuggingWrapper, DebuggingWrapper.step(Interaction)

Field Summary
 int mode
          Store the current debugging mode.
static int STEP
          Constant for stepping.
static int STEP_INTO
          Constant for stepping into
 Stack stepIntoStack
          A stack that allows step into to stop.
 boolean stepping
          Store if the debugger must step or not.
 
Constructor Summary
Debugger()
          The debugger constructor.
 
Method Summary
 void disableStepping()
          Disable stepping.
 void enableStepping()
          Enable stepping If this method is called and that the stepping was disabled, the debugger enters a stepping mode.
 void endOfMethod(String container, String objectName, String method, Object[] args, Object ret, long executionTime)
          This must be called at the end of a stepped method to print the execution informations of the method.
 int getDebuggingMode()
          The getter for the debugging mode.
 boolean isStepping()
          Tell if in stepping mode.
 void setDebuggingMode(int mode)
          Set the debugging mode of the debugger.
 void startOfMethod(String container, String objectName, String method, Object[] args)
          Must be called when a new method is called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STEP

public static final int STEP
Constant for stepping.

See Also:
Constant Field Values

STEP_INTO

public static final int STEP_INTO
Constant for stepping into

See Also:
Constant Field Values

mode

public int mode
Store the current debugging mode.


stepping

public boolean stepping
Store if the debugger must step or not.


stepIntoStack

public transient Stack stepIntoStack
A stack that allows step into to stop.

Constructor Detail

Debugger

public Debugger()
The debugger constructor.

Method Detail

setDebuggingMode

public void setDebuggingMode(int mode)
Set the debugging mode of the debugger. Can be "step", "step_into", or "run".

Parameters:
mode - the new mode
See Also:
getDebuggingMode()

getDebuggingMode

public int getDebuggingMode()
The getter for the debugging mode.

Returns:
the current debugging mode
See Also:
setDebuggingMode(int)

disableStepping

public void disableStepping()
Disable stepping.

If this method is called, the debugger enters a run mode but is still active (a stepping mode can be recovered).

See Also:
isStepping(), enableStepping()

enableStepping

public void enableStepping()
Enable stepping

If this method is called and that the stepping was disabled, the debugger enters a stepping mode.

See Also:
isStepping(), disableStepping()

isStepping

public boolean isStepping()
Tell if in stepping mode.

Returns:
true if stepping
See Also:
enableStepping(), disableStepping()

startOfMethod

public void startOfMethod(String container,
                          String objectName,
                          String method,
                          Object[] args)
Must be called when a new method is called.

If the debugger is in step mode, then, the program stops and the user is asked to press a key to continue.

Parameters:
container - the name of the container that runs the method
objectName - the name of the called object
method - the name of the called method
args - the arguments of the called method

endOfMethod

public void endOfMethod(String container,
                        String objectName,
                        String method,
                        Object[] args,
                        Object ret,
                        long executionTime)
This must be called at the end of a stepped method to print the execution informations of the method.

Parameters:
container - the name of the container that runs the method
objectName - the name of the called object
method - the name of the called method
args - the arguments of the called method
ret - the value returned by the called method
executionTime - the method call duration