com.bluemarsh.jswat.breakpoint
Class TraceBreakpoint

java.lang.Object
  |
  +--com.bluemarsh.jswat.breakpoint.DefaultBreakpoint
        |
        +--com.bluemarsh.jswat.breakpoint.TraceBreakpoint
All Implemented Interfaces:
Breakpoint, java.util.EventListener, java.io.Serializable, SessionListener, VMEventListener

public class TraceBreakpoint
extends DefaultBreakpoint
implements SessionListener

Class TraceBreakpoint implements the Breakpoint interface. It shows each time any method is entered or exited during the execution of the debuggee program.

Author:
Nathan Fiedler
See Also:
Serialized Form

Field Summary
protected  com.sun.jdi.request.MethodEntryRequest entryRequest
          Method entry event request.
protected  com.sun.jdi.request.MethodExitRequest exitRequest
          Method exit event request.
 
Fields inherited from class com.bluemarsh.jswat.breakpoint.DefaultBreakpoint
breakpointGroup, classFilters, conditionList, deleteOnExpire, expireCount, isEnabled, logCategory, monitorList, propertyList, skipCount, stoppedCount, suspendPolicy, threadFilters
 
Fields inherited from interface com.bluemarsh.jswat.breakpoint.Breakpoint
serialVersionUID
 
Fields inherited from interface com.bluemarsh.jswat.event.VMEventListener
PRIORITY_BREAKPOINT, PRIORITY_DEFAULT, PRIORITY_HIGH, PRIORITY_HIGHEST, PRIORITY_LOW, PRIORITY_LOWEST, PRIORITY_SESSION
 
Constructor Summary
TraceBreakpoint(java.lang.String classes, java.lang.String threads)
          Creates a TraceBreakpoint event with the given class and thread filters.
 
Method Summary
 void activate(Session session)
          Called when the Session is about to begin an active debugging session.
 void close(Session session)
          Called when the Session is about to close down.
protected  void createRequests()
          Create the method entry and exit event requests.
 void deactivate(Session session)
          Called when the Session is about to end an active debugging session.
protected  void deleteRequests()
          Delete the method entry and exit event requests.
 void destroy()
          Tear down this breakpoint in preparation for deletion.
 BreakpointUI getUIAdapter()
          Returns the user interface widget for customizing this breakpoint.
 void init()
          Initialize the breakpoint so it may operate normally.
 void init(Session session)
          Called after the Session has added this listener to the Session listener list.
 boolean isResolved()
          Returns true if the breakpoint has been resolved against the intended object in the debuggee VM.
protected  boolean performStop(com.sun.jdi.event.Event e)
          This breakpoint has caused the debuggee VM to stop.
 void reset()
          Reset the stopped count to zero and clear any other attributes such that this breakpoint can be used again for a new session.
 void setEnabled(boolean enabled)
          Enables or disables this breakpoint, according to the parameter.
 void setSuspendPolicy(int policy)
          Set the suspend policy for the request.
protected  java.lang.String showEventLocation(com.sun.jdi.event.LocatableEvent le)
          Return a String describing the location of the given event.
 java.lang.String toString()
          Returns a String representation of this.
 java.lang.String toString(boolean terse)
          Returns a String representation of this.
 
Methods inherited from class com.bluemarsh.jswat.breakpoint.DefaultBreakpoint
addCondition, addMonitor, conditions, deleteOnExpire, eventOccurred, eventRequest, fireChange, getBreakpointGroup, getBreakpointManager, getClassFilters, getExpireCount, getProperty, getSkipCount, getSuspendPolicy, getThreadFilters, hasExpired, incrementStoppedCount, isEnabled, isSkipping, monitors, removeCondition, removeMonitor, setBreakpointGroup, setClassFilters, setExpireCount, setProperty, setSkipCount, setThreadFilters, shouldResume
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

entryRequest

protected transient com.sun.jdi.request.MethodEntryRequest entryRequest
Method entry event request.

exitRequest

protected transient com.sun.jdi.request.MethodExitRequest exitRequest
Method exit event request.
Constructor Detail

TraceBreakpoint

public TraceBreakpoint(java.lang.String classes,
                       java.lang.String threads)
Creates a TraceBreakpoint event with the given class and thread filters.
Parameters:
classes - comma-separated list of class filters, or null if none are given.
threads - comma-separated list of thread filters, or null if none are given.
Method Detail

activate

public void activate(Session session)
Called when the Session is about to begin an active debugging session. That is, JSwat is about to debug a debuggee VM.
Specified by:
activate in interface SessionListener
Parameters:
session - Session being activated.

close

public void close(Session session)
Called when the Session is about to close down.
Specified by:
close in interface SessionListener
Parameters:
session - Session being closed.

createRequests

protected void createRequests()
Create the method entry and exit event requests.

deactivate

public void deactivate(Session session)
Called when the Session is about to end an active debugging session. That is, JSwat is about to terminate the connection with the debuggee VM.
Specified by:
deactivate in interface SessionListener
Parameters:
session - Session being deactivated.

deleteRequests

protected void deleteRequests()
Delete the method entry and exit event requests.

destroy

public void destroy()
Tear down this breakpoint in preparation for deletion.
Overrides:
destroy in class DefaultBreakpoint

getUIAdapter

public BreakpointUI getUIAdapter()
Returns the user interface widget for customizing this breakpoint. This method returns a new ui adapter each time it is called.
Overrides:
getUIAdapter in class DefaultBreakpoint
Returns:
Breakpoint user interface adapter.

init

public void init()
Initialize the breakpoint so it may operate normally.
Overrides:
init in class DefaultBreakpoint

init

public void init(Session session)
Called after the Session has added this listener to the Session listener list.
Specified by:
init in interface SessionListener
Parameters:
session - Session adding this listener.

isResolved

public boolean isResolved()
Returns true if the breakpoint has been resolved against the intended object in the debuggee VM. How a breakpoint resolves itself depends on the type of the breakpoint.
Overrides:
isResolved in class DefaultBreakpoint
Returns:
always returns true.

performStop

protected boolean performStop(com.sun.jdi.event.Event e)
This breakpoint has caused the debuggee VM to stop. Execute all monitors associated with this breakpoint. If the breakpoint is locatable, perform the usual operations that go along with a locatable event.
Overrides:
performStop in class DefaultBreakpoint
Parameters:
e - Event for which we are stopping.
Returns:
true if VM should resume, false otherwise.

reset

public void reset()
Reset the stopped count to zero and clear any other attributes such that this breakpoint can be used again for a new session. This does not change the enabled-ness of the breakpoint.
Overrides:
reset in class DefaultBreakpoint

setEnabled

public void setEnabled(boolean enabled)
Enables or disables this breakpoint, according to the parameter. This only affects the breakpint itself. If the breakpoint group containing this breakpoint is disabled, this breakpoint will remain effectively disabled.
Overrides:
setEnabled in class DefaultBreakpoint
Parameters:
enabled - true if breakpoint should be enabled, false if breakpoint should be disabled.
See Also:
DefaultBreakpoint.isEnabled

setSuspendPolicy

public void setSuspendPolicy(int policy)
Set the suspend policy for the request. Use one of the com.sun.jdi.request.EventRequest constants for suspending threads. The breakpoint must be disabled before calling this method.
Overrides:
setSuspendPolicy in class DefaultBreakpoint
Parameters:
policy - one of the EventRequest suspend constants.

showEventLocation

protected java.lang.String showEventLocation(com.sun.jdi.event.LocatableEvent le)
Return a String describing the location of the given event.
Parameters:
le - locatable event.
Returns:
String descriptor.

toString

public java.lang.String toString()
Returns a String representation of this.
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(boolean terse)
Returns a String representation of this.
Parameters:
terse - true to keep the description terse.