DefaultDebugDriver Class

com.bea.ide.sourceeditor.driver
DefaultDebugDriver Class

public class DefaultDebugDriver

    extends DefaultDocumentDriver
    implements IDebugDriver

Implements IDebugDriver for debugging source files. It supports line breakpoints but not method breakpoints.


Hierarchy
Object
  DefaultDocumentDriver
    DefaultDebugDriver
All Implemented Interfaces

IDebugDriver
Direct Known Subclasses

JavaDebugDriver

Constructor Summary

DefaultDebugDriver(ISourceDocument file)

Creates a DefaultDebugDriver associated with the given file.
 

Method Summary

public boolean
addBreakPoint(ISourceBreakPoint bp)
Sets a break point on the given line in the given file.
public ISourceBreakPoint
createBreakPoint(IDocument file, int line)
This creates a breakpoint with the given URI + line number.
public IDebugBreakPoint
createBreakPoint(IDocument file, IDocumentView view, Point point)
This will be called if we are unable to come up with a line of code to put a breakpoint on.
public ISourceBreakPoint[]
createMethodBreakPoint(IDocument file, String className, String methodName, String[] params)
As this class does not support method breakpoints, this will always return null.
public IDebugBreakPoint
getBreakPoint(IDocument idfile, int line)
Returns the break point for a given line.
public IDebugBreakPoint
getBreakPoint(IDebugBreakPoint bp)
Returns an equivalent breakpoint to the one being passed in, if one exists that the driver knows about.
protected ISourceModel
getSourceModel(ISourceBreakPoint bp)
Convenience method to get the source model for a breakpoint
public boolean
hasInstructionPoint(IDocument idfile, int line)
Tells if the instruction point is on this line in this file.
public void
removeBreakPoint(ISourceBreakPoint bp)
Removes a break point from the given line in the given file.
public IDebugInstructionPoint
setInstructionPoint(IDocument idfile, int line, int type)
Sets an instruction point on a given line.
public void
unsetInstructionPoint(IDebugInstructionPoint ip)
Removes the instruction point from the given line.
 
Methods from  com.bea.ide.sourceeditor.driver.DefaultDocumentDriver
getDocument, setDocument
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.ide.debug.IDebugDriver
addBreakPoint, createBreakPoint, createBreakPoint, createMethodBreakPoint, getBreakPoint, getBreakPoint, hasInstructionPoint, removeBreakPoint, setInstructionPoint, unsetInstructionPoint
 

Constructor Detail

DefaultDebugDriver

public DefaultDebugDriver(ISourceDocument file)
Creates a DefaultDebugDriver associated with the given file.
 

Method Detail

addBreakPoint(ISourceBreakPoint) Method

public boolean addBreakPoint(ISourceBreakPoint bp)
Description copied from IDebugDriver.addBreakPoint(ISourceBreakPoint)
Sets a break point on the given line in the given file.

Parameters

bp
the breakpoint created by a call to one of the create breakpoint calls in this driver.

Returns

true if adding the breakpoint succeeded, false if not. Will fail if there is the requested line number is past the end of the document.

createBreakPoint(IDocument, int) Method

public ISourceBreakPoint createBreakPoint(IDocument file, 
                                          int line)
Description copied from IDebugDriver.createBreakPoint(IDocument, int)
This creates a breakpoint with the given URI + line number. This will not actually be associated with a line in a document, until addBreakPoint is called.

Parameters

file
the file the breakpoint will be created in.
line
the line the breakpoint will be created on.

Returns

a IDebugBreakPoint representing the breakpoint that was created.

createBreakPoint(IDocument, IDocumentView, Point) Method

public IDebugBreakPoint createBreakPoint(IDocument file, 
                                         IDocumentView view, 
                                         Point point)
Description copied from IDebugDriver.createBreakPoint(IDocument, IDocumentView, Point)
This will be called if we are unable to come up with a line of code to put a breakpoint on. We will just send in the point the breakpoint occured on. This breakpoint will not be active, until it is formally added by calling IDebugDriver.addBreakPoint(ISourceBreakPoint).

Parameters

file
the file the breakpoint will be created in.
view
the document view the point refers to.
point
the point to create a breakpoint for, or if null, the currently selected location.

Returns

a IDebugBreakPoint representing the breakpoint that was created.

createMethodBreakPoint(IDocument, String, String, String[]) Method

public ISourceBreakPoint[] createMethodBreakPoint(IDocument file, 
                                                String className, 
                                                String methodName, 
                                                String[] params)
As this class does not support method breakpoints, this will always return null.

Parameters

file
the file the breakpoint is to be created in.
className
the class name to resolve the method in.
methodName
the name of the method to create a breakpoint for.
params
the list of parameters for the method to create a breakpoint for. If this is null, a breakpoint will be created for all methods that match for any set of parameters.

Returns

null

getBreakPoint(IDocument, int) Method

public IDebugBreakPoint getBreakPoint(IDocument idfile, 
                                      int line)
Description copied from IDebugDriver.getBreakPoint(IDocument, int)
Returns the break point for a given line. If there is not a breakpoint currenly set on this line, this will return null. This method will return the exact breakpoint being used, not a copy.

Parameters

idfile
the IDocument to look in for the breakpoint.
line
the line number to look on for the breakpoint.

Returns

null if no breakpoint is on the specified line in the specified file otherwise this will return the breakpoint that is on that line.

getBreakPoint(IDebugBreakPoint) Method

public IDebugBreakPoint getBreakPoint(IDebugBreakPoint bp)
Description copied from IDebugDriver.getBreakPoint(IDebugBreakPoint)
Returns an equivalent breakpoint to the one being passed in, if one exists that the driver knows about. The breakpoint returned will not be the same breakpoint as the one passed in. It will be the exact breakpoint that is being used in the driver. This is important so the DebugSvc can keep track of brekapoint IDs.

Parameters

bp
a breakpoint containing all the information needed for the driver to try to find a match.

Returns

null if no such breakpoint exists, otherwise this will return the exact instance of the breakpoint that is being used.

getSourceModel(ISourceBreakPoint) Method

protected ISourceModel getSourceModel(ISourceBreakPoint bp)
Convenience method to get the source model for a breakpoint

Returns

the source model if the document has been loaded, or null if it has not been loaded

hasInstructionPoint(IDocument, int) Method

public boolean hasInstructionPoint(IDocument idfile, 
                                   int line)
Description copied from IDebugDriver.hasInstructionPoint(IDocument, int)
Tells if the instruction point is on this line in this file.

Parameters

idfile
the file to query for an instruction point.
line
the line to look on for an instruction point.

Returns

a boolean saying whether there was an instruction point added on that line.

removeBreakPoint(ISourceBreakPoint) Method

public void removeBreakPoint(ISourceBreakPoint bp)
Description copied from IDebugDriver.removeBreakPoint(ISourceBreakPoint)
Removes a break point from the given line in the given file.

Parameters

bp
the breakpoint to remove.

setInstructionPoint(IDocument, int, int) Method

public IDebugInstructionPoint setInstructionPoint(IDocument idfile, 
                                                  int line, 
                                                  int type)
Description copied from IDebugDriver.setInstructionPoint(IDocument, int, int)
Sets an instruction point on a given line. This is used for both current execution point, and a stack frame execution point.

Parameters

idfile
the file to set the instruction point in.
line
the line to set the instruction point on.
type
the type of instruction point to set. Currently, the only supported values are: IDebugInstructionPoint.INSTRUCTION_POINT and IDebugInstructionPoint.STACK_FRAME_POINT

unsetInstructionPoint(IDebugInstructionPoint) Method

public void unsetInstructionPoint(IDebugInstructionPoint ip)
Description copied from IDebugDriver.unsetInstructionPoint(IDebugInstructionPoint)
Removes the instruction point from the given line.

Parameters

ip
the IDebugInstructionPoint to remove.