|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.debug.jpda.JPDADebugger
public class JPDADebugger
An integrated debugger which attaches to the Interactions JVM using Sun's Java Platform Debugger Architecture (JPDA/JDI) interface. Every public method in this class throws an llegalStateException if it is called while the debugger is not active, except for isAvailable, isReady, and startUp. Public methods also throw a DebugException if the EventHandlerThread has caught an exception.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.rice.cs.drjava.model.debug.Debugger |
|---|
Debugger.StepType |
| Constructor Summary | |
|---|---|
JPDADebugger(GlobalModel model)
Builds a new JPDADebugger to debug code in the Interactions JVM, using the JPDA/JDI interfaces. |
|
| Method Summary | |
|---|---|
void |
addListener(DebugListener listener)
Adds a listener to this JPDADebugger. |
void |
addWatch(String field)
Adds a watch on the given field or variable. |
DebugModelCallback |
callback()
|
Breakpoint |
getBreakpoint(int line,
String className)
Gets the Breakpoint object at the specified line in the given class. |
ArrayList<DebugStackData> |
getCurrentStackFrameData()
Returns a Vector of DebugStackData for the current suspended thread. |
ArrayList<DebugThreadData> |
getCurrentThreadData()
Returns a list of all threads being tracked by the debugger. |
ArrayList<DebugWatchData> |
getWatches()
Returns all currently watched fields and variables. |
boolean |
hasRunningThread()
Returns whether the thread the debugger is tracking is now running. |
boolean |
hasSuspendedThreads()
Returns whether the debugger currently has any suspended threads. |
boolean |
isAvailable()
Returns whether the debugger is available in this copy of DrJava. |
boolean |
isCurrentThreadSuspended()
Returns whether the debugger's current thread is suspended. |
boolean |
isReady()
Returns whether the debugger is currently enabled. |
void |
notifyBreakpointChange(Breakpoint breakpoint)
Enable or disable the specified breakpoint. |
OpenDefinitionsDocument |
preloadDocument(com.sun.jdi.Location location)
Return the document associated with this location. |
void |
removeAllWatches()
Removes all watches on existing fields and variables. |
void |
removeBreakpoint(Breakpoint bp)
Removes a breakpoint. |
void |
removeListener(DebugListener listener)
Removes a listener to this JPDADebugger. |
void |
removeWatch(int index)
Removes the watch at the given index. |
void |
removeWatch(String field)
Removes any watches on the given field or variable. |
void |
resume()
Resumes the thread currently being debugged, copying back all variables from the current debug interpreter. |
void |
resume(DebugThreadData threadData)
Resumes the given thread, copying back any variables from its associated debug interpreter. |
void |
scrollToSource(Breakpoint bp)
Scrolls to the source of the given breakpoint. |
void |
scrollToSource(DebugStackData stackData)
Scrolls to the source location specified by the the debug stack data. |
void |
setBreakpoint(Breakpoint breakpoint)
Sets a breakpoint. |
void |
setCurrentThread(DebugThreadData threadData)
Sets the notion of current thread to the one contained in threadData. |
void |
shutdown()
Disconnects the debugger from the Interactions JVM and cleans up any state. |
void |
startUp()
Attaches the debugger to the Interactions JVM to prepare for debugging. |
void |
step(Debugger.StepType type)
Steps the execution of the currently loaded document. |
boolean |
toggleBreakpoint(OpenDefinitionsDocument doc,
int offset,
int lineNum,
boolean isEnabled)
Toggles whether a breakpoint is set at the given line in the given document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JPDADebugger(GlobalModel model)
| Method Detail |
|---|
public void addListener(DebugListener listener)
addListener in interface Debuggerlistener - a listener that reacts on events generated by the JPDADebuggerpublic void removeListener(DebugListener listener)
removeListener in interface Debuggerlistener - listener to removepublic boolean isAvailable()
isAvailable in interface Debuggerpublic DebugModelCallback callback()
callback in interface Debuggerpublic boolean isReady()
isReady in interface Debugger
public void startUp()
throws DebugException
startUp in interface DebuggerDebugExceptionpublic void shutdown()
shutdown in interface DebuggerIllegalStateException - if debugger is not ready
public void setCurrentThread(DebugThreadData threadData)
throws DebugException
setCurrentThread in interface DebuggerthreadData - The Thread to set as current.
IllegalStateException - if debugger is not ready
IllegalArgumentException - if threadData is null or not suspended
DebugException
public boolean hasSuspendedThreads()
throws DebugException
hasSuspendedThreads in interface DebuggerDebugException
public boolean isCurrentThreadSuspended()
throws DebugException
isCurrentThreadSuspended in interface DebuggerDebugException
public boolean hasRunningThread()
throws DebugException
hasRunningThread in interface DebuggerDebugException
public void resume()
throws DebugException
resume in interface DebuggerDebugException
public void resume(DebugThreadData threadData)
throws DebugException
resume in interface DebuggerthreadData - Thread to resume
DebugException
public void step(Debugger.StepType type)
throws DebugException
step in interface DebuggerDebugException
public void addWatch(String field)
throws DebugException
addWatch in interface Debuggerfield - the name of the field we will watch
DebugException
public void removeWatch(String field)
throws DebugException
removeWatch in interface Debuggerfield - the name of the field we will watch
DebugException
public void removeWatch(int index)
throws DebugException
removeWatch in interface Debuggerindex - Index of the watch to remove
DebugException
public void removeAllWatches()
throws DebugException
removeAllWatches in interface DebuggerDebugExceptionpublic void notifyBreakpointChange(Breakpoint breakpoint)
breakpoint - breakpoint to change
public boolean toggleBreakpoint(OpenDefinitionsDocument doc,
int offset,
int lineNum,
boolean isEnabled)
throws DebugException
toggleBreakpoint in interface Debuggerdoc - Document in which to set or remove the breakpointoffset - Start offset on the line to set the breakpointlineNum - Line on which to set or remove the breakpoint, >=1isEnabled - true if this breakpoint should be enabled
DebugException
public void setBreakpoint(Breakpoint breakpoint)
throws DebugException
setBreakpoint in interface Debuggerbreakpoint - The new breakpoint to set
DebugException
public void removeBreakpoint(Breakpoint bp)
throws DebugException
removeBreakpoint in interface Debuggerbp - The breakpoint to remove.
DebugException
public ArrayList<DebugWatchData> getWatches()
throws DebugException
getWatches in interface DebuggerDebugException
public ArrayList<DebugThreadData> getCurrentThreadData()
throws DebugException
getCurrentThreadData in interface DebuggerDebugException
public ArrayList<DebugStackData> getCurrentStackFrameData()
throws DebugException
getCurrentStackFrameData in interface DebuggerDebugException - if the current thread is running or there
are no suspended threads
TO DO: Config option for hiding DrJava subset of stack tracepublic OpenDefinitionsDocument preloadDocument(com.sun.jdi.Location location)
public void scrollToSource(DebugStackData stackData)
throws DebugException
scrollToSource in interface DebuggerstackData - Stack data containing location to display
DebugException - if current thread is not suspendedpublic void scrollToSource(Breakpoint bp)
scrollToSource in interface Debuggerbp - the breakpoint
public Breakpoint getBreakpoint(int line,
String className)
getBreakpoint in interface Debuggerline - The line number of the breakpointclassName - The name of the class the breakpoint's in
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||