org.apache.bsf.engines.javascript

Class RhinoEngineDebugger

public class RhinoEngineDebugger extends Object implements Debugger

Constructor Summary
RhinoEngineDebugger(JavaScriptEngine eng)
Method Summary
voiddisconnectedDebuggerNotify()
Called when our debugger has been disconnected.
Objecteval(String docname, String fnOrScript, int lineno)
JsContextgetContext(int depth)
intgetContextCount()
JsCallbacksgetDebugger()
Return the current debugger.
ObjectgetDebugInterface()
DocumentCellgetDocumentCell(String name)
JsObjectgetGlobalObject()
RhinoContextProxygetRhinoContextProxy()
StringgetThread()
StringgetThreadGroup()
JsObjectgetUndefinedValue()
voidhandleBreakpointHit(Context cx)
voidhandleCompilationDone(Context cx, DebuggableScript fnOrScript, StringBuffer source)
voidhandleExceptionThrown(Context cx, Object exceptionThrown)
DocumentCellloadDocumentNotify(String name)
voidplaceBreakpointAtLine(int brkptid, String docname, int lineno)
voidplaceBreakpointAtOffset(int brkptid, String docname, int offset)
voidremoveBreakpoint(String docname, int brkptid)
voidrun(JsEngineStub eng)
voidsetBreakNextLine(JsContext context, boolean isLineStep)
Set whether the engine should break when it encounters the next line.
voidsetDebugger(JsCallbacks debugger)
Set the associated debugger.
voidsetEntryExit(String docname, boolean on)
voidstepIn(JsEngineStub eng)
voidstepOut(JsEngineStub eng)
voidstepOver(JsEngineStub eng)
void_handleBreakpointHit(DocumentCell cell, int lineno)

Constructor Detail

RhinoEngineDebugger

public RhinoEngineDebugger(JavaScriptEngine eng)

Method Detail

disconnectedDebuggerNotify

public void disconnectedDebuggerNotify()
Called when our debugger has been disconnected.

eval

public Object eval(String docname, String fnOrScript, int lineno)

getContext

public JsContext getContext(int depth)

getContextCount

public int getContextCount()

getDebugger

public JsCallbacks getDebugger()
Return the current debugger.

Returns: the debugger, or null if none is attached.

getDebugInterface

public Object getDebugInterface()

getDocumentCell

public DocumentCell getDocumentCell(String name)

getGlobalObject

public JsObject getGlobalObject()

getRhinoContextProxy

public RhinoContextProxy getRhinoContextProxy()

getThread

public String getThread()

getThreadGroup

public String getThreadGroup()

getUndefinedValue

public JsObject getUndefinedValue()

handleBreakpointHit

public void handleBreakpointHit(Context cx)

handleCompilationDone

public void handleCompilationDone(Context cx, DebuggableScript fnOrScript, StringBuffer source)

handleExceptionThrown

public void handleExceptionThrown(Context cx, Object exceptionThrown)

loadDocumentNotify

public DocumentCell loadDocumentNotify(String name)

placeBreakpointAtLine

public void placeBreakpointAtLine(int brkptid, String docname, int lineno)

placeBreakpointAtOffset

public void placeBreakpointAtOffset(int brkptid, String docname, int offset)

removeBreakpoint

public void removeBreakpoint(String docname, int brkptid)

run

public void run(JsEngineStub eng)

setBreakNextLine

public void setBreakNextLine(JsContext context, boolean isLineStep)
Set whether the engine should break when it encounters the next line.

The engine will call the attached debugger's handleBreakpointHit method on the next line it executes if isLineStep is true. May be used from another thread to interrupt execution.

Parameters: isLineStep if true, break next line

setDebugger

public void setDebugger(JsCallbacks debugger)
Set the associated debugger.

Parameters: debugger the debugger to be used on callbacks from the engine.

setEntryExit

public void setEntryExit(String docname, boolean on)

stepIn

public void stepIn(JsEngineStub eng)

stepOut

public void stepOut(JsEngineStub eng)

stepOver

public void stepOver(JsEngineStub eng)

_handleBreakpointHit

public void _handleBreakpointHit(DocumentCell cell, int lineno)