org.openide.debugger
Class Debugger

java.lang.Object
  |
  +--org.openide.debugger.Debugger

public abstract class Debugger
extends Object

Provides a minimal interface between the IDE and a debugger. It permits control of the state of the debugger and creation of breakpoints and watches.


Field Summary
static int ACTION_BREAKPOINT_HIT
           
static int ACTION_STEP_OUT
           
static int ACTION_TRACE_INTO
           
static int ACTION_TRACE_OVER
           
static int DEBUGGER_NOT_RUNNING
          Debugger state when the debugger is not running at all.
static int DEBUGGER_RUNNING
          Debugger state when the debugger is running user code.
static int DEBUGGER_STARTING
          Debugger state when the debugger is starting to run.
static int DEBUGGER_STOPPED
          Debugger state when the debugger is stopped, e.g. at a breakpoint.
static String PROP_BREAKPOINTS
          Name of property for the set of breakpoints in the system.
static String PROP_CURRENT_LINE
          Name of property for the debugger's current line.
static String PROP_STATE
          Name of property for the debugger's state.
static String PROP_WATCHES
          Name of property for the set of watches in the system.
 
Constructor Summary
Debugger()
           
 
Method Summary
abstract  void addPropertyChangeListener(PropertyChangeListener l)
          Add a property change listener.
abstract  Breakpoint createBreakpoint(ConstructorElement method)
          Create a new breakpoint assigned to a method (or constructor).
abstract  Breakpoint createBreakpoint(ConstructorElement method, boolean hidden)
          Create a new breakpoint assigned to a method (or constructor).
abstract  Breakpoint createBreakpoint(Line l)
          Create a new breakpoint assigned to a specific line.
abstract  Breakpoint createBreakpoint(Line l, boolean hidden)
          Create a new breakpoint assigned to a specific line.
abstract  Watch createWatch()
          Create new uninitialized watch.
abstract  Watch createWatch(String expr, boolean hidden)
          Create a watch with its expression set to an initial value.
abstract  Breakpoint findBreakpoint(ConstructorElement method)
          Find the breakpoint assigned to a method (or constructor).
abstract  Breakpoint findBreakpoint(Line l)
          Find the breakpoint assigned to a given line.
abstract  void finishDebugger()
          Finish the debugger session.
abstract  Breakpoint[] getBreakpoints()
          Get all breakpoints in the system.
abstract  Line getCurrentLine()
          Get the current line of debugger.
abstract  int getState()
          Get the state of the debugger.
abstract  Watch[] getWatches()
          Get all watches in the system.
abstract  void go()
          Go.
abstract  void removeAllBreakpoints()
          Remove all breakpoints from the system.
abstract  void removeAllWatches()
          Remove all watches from the system.
abstract  void removePropertyChangeListener(PropertyChangeListener l)
          Remove a property change listener.
abstract  void startDebugger(DebuggerInfo info)
          Start a new debugging session.
abstract  void stepOut()
          Step out (of a statement).
abstract  void traceInto()
          Trace into (a statement).
abstract  void traceOver()
          Trace over (a statement).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUGGER_NOT_RUNNING

public static final int DEBUGGER_NOT_RUNNING
Debugger state when the debugger is not running at all.

DEBUGGER_STARTING

public static final int DEBUGGER_STARTING
Debugger state when the debugger is starting to run.

DEBUGGER_RUNNING

public static final int DEBUGGER_RUNNING
Debugger state when the debugger is running user code.

DEBUGGER_STOPPED

public static final int DEBUGGER_STOPPED
Debugger state when the debugger is stopped, e.g. at a breakpoint.

PROP_STATE

public static final String PROP_STATE
Name of property for the debugger's state.

PROP_BREAKPOINTS

public static final String PROP_BREAKPOINTS
Name of property for the set of breakpoints in the system.

PROP_WATCHES

public static final String PROP_WATCHES
Name of property for the set of watches in the system.

PROP_CURRENT_LINE

public static final String PROP_CURRENT_LINE
Name of property for the debugger's current line.

ACTION_BREAKPOINT_HIT

public static final int ACTION_BREAKPOINT_HIT

ACTION_TRACE_OVER

public static final int ACTION_TRACE_OVER

ACTION_TRACE_INTO

public static final int ACTION_TRACE_INTO

ACTION_STEP_OUT

public static final int ACTION_STEP_OUT
Constructor Detail

Debugger

public Debugger()
Method Detail

startDebugger

public abstract void startDebugger(DebuggerInfo info)
                            throws DebuggerException
Start a new debugging session. The current debugging session, if any, should be stopped first. The provided information specifies the class to start and arguments to pass it, and the name of class to stop debugging in, if applicable.
Parameters:
info - debugger startup info
Throws:
DebuggerException - if an error occurs while starting the debugger

finishDebugger

public abstract void finishDebugger()
                             throws DebuggerException
Finish the debugger session.
Throws:
DebuggerException - if there was problem during cleanup

traceInto

public abstract void traceInto()
                        throws DebuggerException
Trace into (a statement).
Throws:
DebuggerException - if there is a problem during execution

traceOver

public abstract void traceOver()
                        throws DebuggerException
Trace over (a statement).
Throws:
DebuggerException - if there is a problem during execution

go

public abstract void go()
                 throws DebuggerException
Go. This should continue executing user code until a breakpoint is hit or the debugger finishes.
Throws:
DebuggerException - if there is a problem during execution

stepOut

public abstract void stepOut()
                      throws DebuggerException
Step out (of a statement).
Throws:
DebuggerException - if there is a problem during execution

createBreakpoint

public abstract Breakpoint createBreakpoint(Line l)
Create a new breakpoint assigned to a specific line. The line is represented by a line object that can change its position as the text is modified.
Parameters:
l - line to create breakpoint at
Returns:
the new breakpoint

createBreakpoint

public abstract Breakpoint createBreakpoint(Line l,
                                            boolean hidden)
Create a new breakpoint assigned to a specific line. Allows creation of a hidden breakpoint.
Parameters:
l - line to create breakpoint at
hidden - true if the breakpoint should be hidden from the user
Returns:
the new breakpoint

findBreakpoint

public abstract Breakpoint findBreakpoint(Line l)
Find the breakpoint assigned to a given line.
Parameters:
l - line to find the breakpoint at
Returns:
the breakpoint or null if there is no such breakpoint

createBreakpoint

public abstract Breakpoint createBreakpoint(ConstructorElement method)
Create a new breakpoint assigned to a method (or constructor). The method is represented by a method (or constructor) source element that must have a declaring class.
Parameters:
method - method or constructor with valid declaring class
Returns:
the new breakpoint
Throws:
IllegalArgumentException - if the method does not have a declaring class

createBreakpoint

public abstract Breakpoint createBreakpoint(ConstructorElement method,
                                            boolean hidden)
Create a new breakpoint assigned to a method (or constructor). The method is represented by a method (or constructor) source element that must have a declaring class. Allows creation of a hidden breakpoint.
Parameters:
method - method or constructor with valid declaring class
hidden - true if the breakpoint should be hidden from the user
Returns:
the new breakpoint
Throws:
IllegalArgumentException - if the method does not have a declaring class

findBreakpoint

public abstract Breakpoint findBreakpoint(ConstructorElement method)
Find the breakpoint assigned to a method (or constructor).
Parameters:
method - method or constructor to find the breakpoint of
Returns:
the breakpoint or null if there is no such breakpoint
Throws:
IllegalArgumentException - if the method does not have a declaring class

getBreakpoints

public abstract Breakpoint[] getBreakpoints()
Get all breakpoints in the system.
Returns:
all breakpoints

removeAllBreakpoints

public abstract void removeAllBreakpoints()
Remove all breakpoints from the system.

createWatch

public abstract Watch createWatch()
Create new uninitialized watch. The watch is visible (not hidden).
Returns:
the new watch

createWatch

public abstract Watch createWatch(String expr,
                                  boolean hidden)
Create a watch with its expression set to an initial value. Also allows creation of a hidden watch (not presented to the user), for example for internal use in the editor to obtain values of variables under the mouse pointer.
Parameters:
expr - expression to watch for (the format is the responsibility of the debugger implementation, but it is typically a variable name)
hidden - true if the watch should be hidden from the user
Returns:
the new watch

getWatches

public abstract Watch[] getWatches()
Get all watches in the system.
Returns:
all watches

removeAllWatches

public abstract void removeAllWatches()
Remove all watches from the system.

getState

public abstract int getState()
Get the state of the debugger.
Returns:
DEBUGGER_NOT_RUNNING, DEBUGGER_RUNNING, DEBUGGER_STOPPED, or DEBUGGER_STARTING

getCurrentLine

public abstract Line getCurrentLine()
Get the current line of debugger.
Returns:
current line

addPropertyChangeListener

public abstract void addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener.
Parameters:
l - the listener to add

removePropertyChangeListener

public abstract void removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener.
Parameters:
l - the listener to remove


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.