S-PLUS Connect/Java v1.0

com.insightful.splus
Class SplusDebugHandler

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bycom.insightful.splus.SplusDebugHandler
All Implemented Interfaces:
Remote, Serializable, com.insightful.splus.SplusDebugHandlerInterface

public class SplusDebugHandler
extends UnicastRemoteObject
implements com.insightful.splus.SplusDebugHandlerInterface

The intent of this class is to provide a single entry/exit point for the debug functionality contained in the S-PLUS engine and accessed via the java connection. It is intended to be a relatively thread-safe gateway that will send requests to the engine, block when needed, and notify listeners when appropriate info has been recieved back from the engine. It should never be instantiated by another class and is meant to be accessed via the static calls.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
SplusDebugHandler()
          Default constructor just starts the job queue for communication with the engine
 
Method Summary
 void addBreakpoint(String functionName, String outerFunctionName, long[] functionAddress)
          wrapper function used to call native add breakpoing method as a blocking request
 void addSplusDebugListener(SplusDebugListener listener)
          add an SplusDebugListener...listners will be notified whenever new debug info is recieved from the engine
 void doCallStack(long exprID)
          wrapper function used to call native call stack method as a blocking request
 void doEvaluate(long exprID, String expr)
          wrapper function used to call native evaluation method as a blocking request
 void doFrameDown(long exprID)
          wrapper function used to call native frame down method
 void doFrameUp(long exprID)
          wrapper function used to call native frame up method
 void doInvisibleEvaluate(long exprID, String expr)
          wrapper function used to call native evaluation method (add's invisible wrapper)
 void doObjects(long exprID)
          wrapper function used to call native objects method as a blocking request
 boolean doParse(String expr)
          wrapper function used to call native parse method
 void doPause(long exprID)
          wrapper function used to call native pause method
 void doResume(long exprID)
          wrapper function used to call native resume method
 void doSetCommandLine(boolean commandLine)
          wrapper function used to call native set command line method
 long doStart(String expr)
          wrapper function used to call native start method
 void doStep(long exprID)
          wrapper function used to call native step method
 void doStepIn(long exprID)
          wrapper function used to call native step in method
 void doStepOut(long exprID)
          wrapper function used to call native step out method
 void doStop(long exprID)
          wrapper function used to call native stop method
 long[] getBreakAddress()
          get the current address relative to the currnet top-level function
 String getBreakInfo()
          get the current description
 String getCall(int i)
          get a particular call description
 String getCallName(int i)
          get a particular stack function name
 String getContainerCallName(int i)
          get a particular stack top-level function name
 String getEval(String request, int i)
          get a particular evaluation of an expression
static SplusDebugHandler getInstance()
          get singleton instance of the SplusDebugHandler
 int getNumCalls()
          get number of stack frames recieved from the engine
 int getNumEvals(String request)
          get the nubmer of evaluations recived for a given expression
 int getNumObjects()
          retrieves the number of objects recieved from the engine
 String[] getObjectData(int i)
          retrieve a particular object's data in a string array of length 6 in the following order: class, mode, length, extent, creation date, & value.
 String getObjectName(int i)
          retrieve a particular object name
 void removeBreakpoint(String functionName, String outerFunctionName, long[] functionAddress)
          wrapper function used to call native remove breakpoint method as a blocking request
 void removeSplusDebugListener(SplusDebugListener listener)
          remove an SplusDebugListener
static void setBreakInfo(String breakInfo, long[] breakAddress)
          called from the engine to store the furrent expression and it's address
static void setCallStackInfo(String[] funNames, String[] containerFunctions, String[] stackItems)
          called from the engine to store info about the call stack.
 void setDebugMode(boolean debug)
          wrapper function used to call native set debug mode and command line methods
 void setErrorBreakpoint(boolean set)
          wrapper function used to call native set error breakpoint method
static void setEvalInfo(String request, String[] evalVals)
          called from the engine to store expression evaluations
static void setObjectsInfo(String[] objNames, String[] objClass, String[] objMode, String[] objLength, String[] objExtent, String[] objDate, String[] objValue)
          called from the engine to store info about the objects in the current frame.
 void setWarningBreakpoint(boolean set)
          wrapper function used to call native set warning breakpoint method
 void start()
          make sure the job queue has started and that it isn't waiting for info
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SplusDebugHandler

public SplusDebugHandler()
                  throws RemoteException
Default constructor just starts the job queue for communication with the engine

Method Detail

getInstance

public static SplusDebugHandler getInstance()
                                     throws RemoteException
get singleton instance of the SplusDebugHandler

Throws:
RemoteException

start

public void start()
           throws RemoteException
make sure the job queue has started and that it isn't waiting for info

Specified by:
start in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

setObjectsInfo

public static void setObjectsInfo(String[] objNames,
                                  String[] objClass,
                                  String[] objMode,
                                  String[] objLength,
                                  String[] objExtent,
                                  String[] objDate,
                                  String[] objValue)
                           throws RemoteException
called from the engine to store info about the objects in the current frame.

Parameters:
objNames - list of object names
objClass - list of object classes
objMode - list of object modes
objLength - list of object lengths
objExtent - list of object extents
objDate - list of object creation dates
objValue - list of object values as if the object had been printed using print(object)
Throws:
RemoteException

getNumObjects

public int getNumObjects()
                  throws RemoteException
retrieves the number of objects recieved from the engine

Specified by:
getNumObjects in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

getObjectName

public String getObjectName(int i)
                     throws RemoteException
retrieve a particular object name

Specified by:
getObjectName in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

getObjectData

public String[] getObjectData(int i)
retrieve a particular object's data in a string array of length 6 in the following order: class, mode, length, extent, creation date, & value.

Specified by:
getObjectData in interface com.insightful.splus.SplusDebugHandlerInterface

setCallStackInfo

public static void setCallStackInfo(String[] funNames,
                                    String[] containerFunctions,
                                    String[] stackItems)
                             throws RemoteException
called from the engine to store info about the call stack.

Parameters:
funNames - string array of function names
containerFunctions - string array of any top-level function names (for example, if foo is defined inside bar, then foo is the funName and bar is the containerFunction)
stackItems - string array of stack item descriptions
Throws:
RemoteException

getNumCalls

public int getNumCalls()
                throws RemoteException
get number of stack frames recieved from the engine

Specified by:
getNumCalls in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

getCall

public String getCall(int i)
               throws RemoteException
get a particular call description

Specified by:
getCall in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

getCallName

public String getCallName(int i)
                   throws RemoteException
get a particular stack function name

Specified by:
getCallName in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

getContainerCallName

public String getContainerCallName(int i)
                            throws RemoteException
get a particular stack top-level function name

Specified by:
getContainerCallName in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

setEvalInfo

public static void setEvalInfo(String request,
                               String[] evalVals)
                        throws RemoteException
called from the engine to store expression evaluations

Parameters:
request - the expression that has been evaluated
evalVals - an array of values the expression evaluated to.
Throws:
RemoteException

getNumEvals

public int getNumEvals(String request)
                throws RemoteException
get the nubmer of evaluations recived for a given expression

Specified by:
getNumEvals in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

getEval

public String getEval(String request,
                      int i)
               throws RemoteException
get a particular evaluation of an expression

Specified by:
getEval in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

setBreakInfo

public static void setBreakInfo(String breakInfo,
                                long[] breakAddress)
                         throws RemoteException
called from the engine to store the furrent expression and it's address

Parameters:
breakInfo - string description of the current expression
breakAddress - address of current expression relative to the top-level function
Throws:
RemoteException

getBreakInfo

public String getBreakInfo()
                    throws RemoteException
get the current description

Specified by:
getBreakInfo in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

getBreakAddress

public long[] getBreakAddress()
                       throws RemoteException
get the current address relative to the currnet top-level function

Specified by:
getBreakAddress in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

addSplusDebugListener

public void addSplusDebugListener(SplusDebugListener listener)
                           throws RemoteException
add an SplusDebugListener...listners will be notified whenever new debug info is recieved from the engine

Specified by:
addSplusDebugListener in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

removeSplusDebugListener

public void removeSplusDebugListener(SplusDebugListener listener)
                              throws RemoteException
remove an SplusDebugListener

Specified by:
removeSplusDebugListener in interface com.insightful.splus.SplusDebugHandlerInterface
Throws:
RemoteException

doSetCommandLine

public void doSetCommandLine(boolean commandLine)
wrapper function used to call native set command line method

Specified by:
doSetCommandLine in interface com.insightful.splus.SplusDebugHandlerInterface

doParse

public boolean doParse(String expr)
wrapper function used to call native parse method

Specified by:
doParse in interface com.insightful.splus.SplusDebugHandlerInterface

doStart

public long doStart(String expr)
wrapper function used to call native start method

Specified by:
doStart in interface com.insightful.splus.SplusDebugHandlerInterface

doStop

public void doStop(long exprID)
wrapper function used to call native stop method

Specified by:
doStop in interface com.insightful.splus.SplusDebugHandlerInterface

doPause

public void doPause(long exprID)
wrapper function used to call native pause method

Specified by:
doPause in interface com.insightful.splus.SplusDebugHandlerInterface

doResume

public void doResume(long exprID)
wrapper function used to call native resume method

Specified by:
doResume in interface com.insightful.splus.SplusDebugHandlerInterface

doStep

public void doStep(long exprID)
wrapper function used to call native step method

Specified by:
doStep in interface com.insightful.splus.SplusDebugHandlerInterface

doStepIn

public void doStepIn(long exprID)
wrapper function used to call native step in method

Specified by:
doStepIn in interface com.insightful.splus.SplusDebugHandlerInterface

doStepOut

public void doStepOut(long exprID)
wrapper function used to call native step out method

Specified by:
doStepOut in interface com.insightful.splus.SplusDebugHandlerInterface

doFrameUp

public void doFrameUp(long exprID)
wrapper function used to call native frame up method

Specified by:
doFrameUp in interface com.insightful.splus.SplusDebugHandlerInterface

doFrameDown

public void doFrameDown(long exprID)
wrapper function used to call native frame down method

Specified by:
doFrameDown in interface com.insightful.splus.SplusDebugHandlerInterface

doInvisibleEvaluate

public void doInvisibleEvaluate(long exprID,
                                String expr)
wrapper function used to call native evaluation method (add's invisible wrapper)

Specified by:
doInvisibleEvaluate in interface com.insightful.splus.SplusDebugHandlerInterface

doEvaluate

public void doEvaluate(long exprID,
                       String expr)
wrapper function used to call native evaluation method as a blocking request

Specified by:
doEvaluate in interface com.insightful.splus.SplusDebugHandlerInterface

doObjects

public void doObjects(long exprID)
wrapper function used to call native objects method as a blocking request

Specified by:
doObjects in interface com.insightful.splus.SplusDebugHandlerInterface

doCallStack

public void doCallStack(long exprID)
wrapper function used to call native call stack method as a blocking request

Specified by:
doCallStack in interface com.insightful.splus.SplusDebugHandlerInterface

addBreakpoint

public void addBreakpoint(String functionName,
                          String outerFunctionName,
                          long[] functionAddress)
wrapper function used to call native add breakpoing method as a blocking request

Specified by:
addBreakpoint in interface com.insightful.splus.SplusDebugHandlerInterface

removeBreakpoint

public void removeBreakpoint(String functionName,
                             String outerFunctionName,
                             long[] functionAddress)
wrapper function used to call native remove breakpoint method as a blocking request

Specified by:
removeBreakpoint in interface com.insightful.splus.SplusDebugHandlerInterface

setDebugMode

public void setDebugMode(boolean debug)
wrapper function used to call native set debug mode and command line methods

Specified by:
setDebugMode in interface com.insightful.splus.SplusDebugHandlerInterface

setErrorBreakpoint

public void setErrorBreakpoint(boolean set)
wrapper function used to call native set error breakpoint method

Specified by:
setErrorBreakpoint in interface com.insightful.splus.SplusDebugHandlerInterface

setWarningBreakpoint

public void setWarningBreakpoint(boolean set)
wrapper function used to call native set warning breakpoint method

Specified by:
setWarningBreakpoint in interface com.insightful.splus.SplusDebugHandlerInterface

S-PLUS Connect/Java v1.0

Copyright © 2000, 2002 Insightful Corporation
Warning: Classes not documented in the S-PLUS Programmer's Guide may change in future releases.