|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bluemarsh.jswat.DefaultManager | +--com.bluemarsh.jswat.ContextManager
Class ContextManager is responsible for holding the current context of the debugger. It holds a reference to the current thread, the current source line (if stepping), the current frame in the thread stack, etc.
Field Summary | |
protected int |
currentFrame
Zero-based index of the current stack frame. |
protected com.sun.jdi.Location |
currentLocation
Location that we're currently stepping through. |
protected com.sun.jdi.ThreadReference |
currentThread
Reference to the current thread. |
protected int |
latestFrameCount
Count of the stack frames from the current thread. |
protected com.bluemarsh.util.EventListenerList |
listeners
List of context listeners. |
Fields inherited from class com.bluemarsh.jswat.DefaultManager |
swat |
Constructor Summary | |
ContextManager()
Constructs a new ContextManager object. |
Method Summary | |
void |
addContextListener(ContextListener listener)
Add a context listener to this manager object. |
void |
deactivate(Session session)
Called when the Session is about to end an active debugging session. |
protected void |
fireChange(com.sun.jdi.ThreadReference oldThrd,
com.sun.jdi.Location oldLoc,
int oldFrame)
Let all the change listeners know of a recent change in the context. |
int |
getCurrentFrame()
Returns the current thread's frame index. |
com.sun.jdi.Location |
getCurrentLocation()
Get the location that the debugger is presently stepping through. |
com.sun.jdi.StackFrame |
getCurrentStackFrame()
Returns the current thread's stack frame. |
com.sun.jdi.ThreadReference |
getCurrentThread()
Returns the ThreadReference to the current thread object. |
protected com.sun.jdi.Location |
getLocationFromFrame(int frame)
Uses the current thread and the given stack frame index to get the Location. |
void |
removeContextListener(ContextListener listener)
Remove a context listener from the listener list. |
void |
setCurrentFrame(int frame)
Sets the current thread's stack frame. |
void |
setCurrentLocation(com.sun.jdi.event.LocatableEvent le)
Set the location and thread that the debugger is presently examining. |
void |
setCurrentThread(com.sun.jdi.ThreadReference thread)
Sets the current thread to the one given. |
Methods inherited from class com.bluemarsh.jswat.DefaultManager |
activate, close, init |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected com.sun.jdi.ThreadReference currentThread
protected int currentFrame
protected com.sun.jdi.Location currentLocation
protected com.bluemarsh.util.EventListenerList listeners
protected int latestFrameCount
Constructor Detail |
public ContextManager()
Method Detail |
public void addContextListener(ContextListener listener)
listener
- new listener to add notification listpublic void deactivate(Session session)
deactivate
in class DefaultManager
session
- Session being deactivated.protected void fireChange(com.sun.jdi.ThreadReference oldThrd, com.sun.jdi.Location oldLoc, int oldFrame)
oldThrd
- previous value for current threadoldLoc
- previous value for current locationoldFrame
- previous value for current framepublic int getCurrentFrame()
public com.sun.jdi.Location getCurrentLocation()
public com.sun.jdi.StackFrame getCurrentStackFrame() throws com.sun.jdi.IncompatibleThreadStateException, java.lang.IndexOutOfBoundsException, com.sun.jdi.ObjectCollectedException
com.sun.jdi.IncompatibleThreadStateException
- Thrown if current thread is not suspended.java.lang.IndexOutOfBoundsException
- Thrown if current frame is < 0 or >= frame count.com.sun.jdi.ObjectCollectedException
- Thrown if this object has been collected.public com.sun.jdi.ThreadReference getCurrentThread()
protected com.sun.jdi.Location getLocationFromFrame(int frame)
frame
- Frame index into current thread's stack.public void removeContextListener(ContextListener listener)
listener
- listener to remove from notification listpublic void setCurrentFrame(int frame) throws com.sun.jdi.IncompatibleThreadStateException, java.lang.IndexOutOfBoundsException
frame
- New current stack frame. Must be between zero
and the number of stack frames minus one, inclusive.com.sun.jdi.IncompatibleThreadStateException
- Thrown if current thread is not suspended.java.lang.IndexOutOfBoundsException
- Thrown if frame is < 0 or >= frame count.java.lang.IllegalStateException
- Thrown if current thread is not set.public void setCurrentLocation(com.sun.jdi.event.LocatableEvent le)
loc
- Current location of debugger, or null to reset.public void setCurrentThread(com.sun.jdi.ThreadReference thread)
thread
- New current thread.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |