public interface Session
Modifier and Type | Method and Description |
---|---|
boolean |
bind()
Allow the session to start communicating with the player.
|
void |
breakOnCaughtExceptions(boolean b)
The player always halts on exceptions that are not going to be caught;
this call allows the debugger to control its behavior when an exception
that *will* be caught is thrown.
|
Value |
callConstructor(String classname,
Value[] args)
Invokes a constructor in the player.
|
Value |
callFunction(Value thisObject,
String functionName,
Value[] args)
Invokes a function.
|
Location |
clearBreakpoint(Location location)
Remove a breakpoint at given location.
|
boolean |
clearExceptionBreakpoint(String exceptionClass)
Clears an exception breakpoint.
|
Watch |
clearWatch(Watch watch)
Remove a previously created watchpoint.
|
Value |
evalAs(Value value,
Value type)
Evaluate the ActionScript expression "value as type"
|
boolean |
evalIn(Value property,
Value object)
Evaluate the ActionScript expression "property in object"
|
boolean |
evalInstanceof(Value value,
String type)
Evaluate the ActionScript expression "value instanceof type"
|
boolean |
evalInstanceof(Value value,
Value type)
Evaluate the ActionScript expression "value instanceof type"
|
boolean |
evalIs(Value value,
String type)
Evaluate the ActionScript expression "value is type"
|
boolean |
evalIs(Value value,
Value type)
Evaluate the ActionScript expression "value is type"
|
Location[] |
getBreakpointList()
Get a list of the current breakpoints.
|
Exception |
getDisconnectCause()
Returns the root SocketException that caused the rxMessage()
thread to shut down.
|
int |
getEventCount()
Returns the number of events currently in the queue.
|
Frame[] |
getFrames()
Returns an array of frames that identify the location and contain
arguments, locals and 'this' information for each frame on the
function call stack.
|
Value |
getGlobal(String name)
Looks up a global name, like "MyClass", "String", etc.
|
Process |
getLaunchProcess()
Returns the Process object, if any, that triggered this Session.
|
int |
getPreference(String pref)
Return the value of a particular preference item
|
SourceLocator |
getSourceLocator()
Gets the SourceLocator for this session.
|
SwfInfo[] |
getSwfs()
Obtain information about the various SWF(s) that have been
loaded into the Player, for this session.
|
String |
getURI()
Returns the URL that identifies this Session.
|
Value |
getValue(long valueId)
From a given value identifier return a Value.
|
Variable[] |
getVariableList()
Deprecated.
As of version 2.
|
Watch[] |
getWatchList()
Get a list of the current watchpoint.
|
Isolate[] |
getWorkers()
Get an array of all workers that the debugger knows of.
|
IsolateSession |
getWorkerSession(int isolateId)
Return the worker specific session object that can be used
to communicate with that worker.
|
boolean |
isConnected()
Is the Player currently connected for this session.
|
boolean |
isSuspended()
Is the Player currently halted awaiting requests, such as continue,
stepOut, stepIn, stepOver.
|
DebugEvent |
nextEvent()
Removes and returns the next event from queue
|
Isolate[] |
refreshWorkers()
Ask the player again for a list of all workers.
|
void |
resume()
Continue a halted session.
|
Location |
setBreakpoint(int fileId,
int lineNum)
Set a breakpoint on a line within the given file.
|
boolean |
setExceptionBreakpoint(String exceptionClass)
Set an exception breakpoint.
|
void |
setLauncher(ILauncher launcher)
Sets the ILauncher instance which is associated with this session.
|
void |
setPreference(String pref,
int value)
Adjust the preferences for this session; see SessionManager
for a list of valid preference strings.
|
void |
setSourceLocator(SourceLocator sourceLocator)
Sets the SourceLocator for this session.
|
Watch |
setWatch(Value v,
String memberName,
int kind)
Set a watchpoint on a given variable.
|
Watch |
setWatch(Watch watch)
Enables or disables a watchpoint.
|
void |
stepContinue()
Continue the process of stepping.
|
void |
stepInto()
Step to the next executable source line within the
program, will enter into functions.
|
void |
stepOut()
Step out of the current method/function onto the
next executable soruce line.
|
void |
stepOver()
Step to the next executable source line within
the program, will NOT enter into functions.
|
boolean |
supportsConcurrency()
Returns whether the target player supports concurrency.
|
boolean |
supportsWatchpoints()
Returns whether the target player supports watchpoints.
|
void |
suspend()
Halt a running session.
|
int |
suspendReason()
Returns a SuspendReason integer which indicates
why the Player has suspended execution.
|
void |
terminate()
Permanently stops the debugging session and breaks the connection.
|
void |
unbind()
Permanently stops the debugging session and breaks the
connection.
|
void |
waitForEvent()
Events provide a mechanism whereby status information is provided from
the Player in a timely fashion.
|
String getURI()
Process getLaunchProcess()
void setPreference(String pref, int value)
pref
- preference name, one of the strings listed abovevalue
- value to set for preferenceint getPreference(String pref) throws NullPointerException
pref
- preference name, one of the strings listed in SessionManager
NullPointerException
- if pref does not existSessionManager
boolean isConnected()
boolean bind() throws VersionException
VersionException
- connected to Player which does not support all API completelyvoid unbind()
Note: this method allows the caller to disconnect from the debugging session (and Player) without terminating the Player. A subsequent call to terminate() will destroy the Player process.
Under normal circumstances this method need not be called since a call to terminate() performs both actions of disconnecting from the Player and destroying the Player process.
void terminate()
Note that due to platform and browser differences, it should not be assumed that this function will necessarily kill the process being debugged. For example:
If SessionManager.launch() was used to initiate the Session then calling this function also causes getLaunchProcess().destroy() to be called.
Note: this method first calls unbind() if needed.
void resume() throws NotSuspendedException, NotConnectedException, NoResponseException
suspend()
method is called.
This method will NOT block. It will return immediately after the Player resumes execution. Use the isSuspended method to determine when the Player has halted.
NoResponseException
- if times outNotSuspendedException
- if Player is already runningNotConnectedException
- if Player is disconnected from Sessionvoid suspend() throws SuspendedException, NotConnectedException, NoResponseException
This method WILL BLOCK until the Player halts for some reason or an error occurs. During this period, one or more callbacks may be initiated.
NoResponseException
- if times outSuspendedException
- if Player is already suspendedNotConnectedException
- if Player is disconnected from Sessionboolean isSuspended() throws NotConnectedException
NotConnectedException
- if Player is disconnected from Sessionint suspendReason() throws NotConnectedException
NotConnectedException
- if Player is disconnected from SessionFrame[] getFrames() throws NotConnectedException
NotConnectedException
- if Player is disconnected from Sessionvoid stepInto() throws NotSuspendedException, NoResponseException, NotConnectedException
This method will NOT block. It will return immediately after the Player resumes execution. Use the isSuspended method to determine when the Player has halted.
NoResponseException
- if times outNotSuspendedException
- if Player is runningNotConnectedException
- if Player is disconnected from Sessionvoid stepOut() throws NotSuspendedException, NoResponseException, NotConnectedException
This method will NOT block. It will return immediately after the Player resumes execution. Use the isSuspended method to determine when the Player has halted.
NoResponseException
- if times outNotSuspendedException
- if Player is runningNotConnectedException
- if Player is disconnected from Sessionvoid stepOver() throws NotSuspendedException, NoResponseException, NotConnectedException
This method will NOT block. It will return immediately after the Player resumes execution. Use the isSuspended method to determine when the Player has halted.
NoResponseException
- if times outNotSuspendedException
- if Player is runningNotConnectedException
- if Player is disconnected from Sessionvoid stepContinue() throws NotSuspendedException, NoResponseException, NotConnectedException
NoResponseException
- if times outNotSuspendedException
- if Player is runningNotConnectedException
- if Player is disconnected from SessionSwfInfo[] getSwfs() throws NoResponseException
NoResponseException
- if times outLocation[] getBreakpointList() throws NoResponseException, NotConnectedException
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from SessionLocation setBreakpoint(int fileId, int lineNum) throws NoResponseException, NotConnectedException
Warning: setBreakpoint()
and
clearBreakpoint()
do not keep track of how many times they
have been called for a given Location. For example, if you make two calls
to setBreakpoint()
for file X.as line 10, and then one
call to clearBreakpoint()
for that same file and line,
then the breakpoint is gone. So, the caller is responsible for keeping
track of whether the user has set two breakpoints at the same location.
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from SessionLocation clearBreakpoint(Location location) throws NoResponseException, NotConnectedException
Warning: setBreakpoint()
and
clearBreakpoint()
do not keep track of how many times they
have been called for a given Location. For example, if you make two calls
to setBreakpoint()
for file X.as line 10, and then one
call to clearBreakpoint()
for that same file and line,
then the breakpoint is gone. So, the caller is responsible for keeping
track of whether the user has set two breakpoints at the same location.
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from SessionWatch[] getWatchList() throws NoResponseException, NotConnectedException
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from SessionWatch setWatch(Value v, String memberName, int kind) throws NoResponseException, NotConnectedException, NotSupportedException
Specification of the variable item to be watched requires two pieces of information (similar to setScalarMember()) The Variable and the name of the particular member to be watched within the variable. For example if the watchpoint is to be applied to 'a.b.c'. First the Value for object 'a.b' must be obtained and then the call setWatch(v, "c", ...) can be issued. The watchpoint can be triggered (i.e. the Player suspended) when either a read or write (or either) occurs on the variable. If the Player is suspended due to a watchpoint being fired, then the suspendReason() call will return SuspendReason.WATCH.
Setting a watchpoint multiple times on the same variable will result in the old watchpoint being removed from the list and a new watchpoint being added to the end of the list.
Likewise, if a previously existing watchpoint is modified by specifiying a different kind variable then the old watchpoint will be removed from the list and a new watchpoint will be added to the end of the list.
v
- the variable, upon whose member, the watch is to be placed.varName
- is the mmeber name upon which the watch
should be placed. This variable name may NOT contain the dot ('.')
character and MUST be a member of v.kind
- access type that will trigger the watchpoint to fire --
read, write, or read/write. See WatchKind
.NoResponseException
- if times outNotConnectedException
- if Player is disconnected from SessionNotSupportedException
- if the Player does not support watchpoints,
or does not support watchpoints on this particular member (e.g. because
it is a getter or a dynamic variable).WatchKind
Watch setWatch(Watch watch) throws NoResponseException, NotConnectedException, NotSupportedException
watch
- the watch to enable or disableenabled
- whether to enable it or disable itNotSupportedException
NotConnectedException
NoResponseException
Watch clearWatch(Watch watch) throws NoResponseException, NotConnectedException
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from SessionVariable[] getVariableList() throws NotSuspendedException, NoResponseException, NotConnectedException, VersionException
Value getValue(long valueId) throws NotSuspendedException, NoResponseException, NotConnectedException
valueId
- identifier from Value class or
from a call to Value.getId()NoResponseException
- if times outNotSuspendedException
- if Player is runningNotConnectedException
- if Player is disconnected from SessionValue getGlobal(String name) throws NotSuspendedException, NoResponseException, NotConnectedException
null
if the global does not exist.NotSuspendedException
NoResponseException
NotConnectedException
void waitForEvent() throws NotConnectedException, InterruptedException
The caller has the option of either polling the event queue via
nextEvent()
or calling waitForEvent()
which
blocks the calling thread until one or more events exist in the queue.
NotConnectedException
- if Session is disconnected from PlayerInterruptedException
int getEventCount()
DebugEvent nextEvent()
SourceLocator getSourceLocator()
void setSourceLocator(SourceLocator sourceLocator)
Value callConstructor(String classname, Value[] args) throws PlayerDebugException
PlayerDebugException
Value callFunction(Value thisObject, String functionName, Value[] args) throws PlayerDebugException
callFunction(myobj, "toString", new Value[0])
will call
myobj.toString()
. Not supported in Player 9 or AIR 1.0.
If you call this function and the player to which you are connected
doesn't support this feature, this will throw a PlayerDebugException.PlayerDebugException
void breakOnCaughtExceptions(boolean b) throws NotSupportedException, NoResponseException
NotSupportedException
- thrown by older players that don't support this feature.NoResponseException
boolean evalIs(Value value, Value type) throws PlayerDebugException, PlayerFaultException
boolean evalIs(Value value, String type) throws PlayerDebugException, PlayerFaultException
boolean evalInstanceof(Value value, Value type) throws PlayerDebugException, PlayerFaultException
boolean evalInstanceof(Value value, String type) throws PlayerDebugException, PlayerFaultException
boolean evalIn(Value property, Value object) throws PlayerDebugException, PlayerFaultException
Value evalAs(Value value, Value type) throws PlayerDebugException, PlayerFaultException
boolean supportsWatchpoints()
setWatch(Value, String, int)
Exception getDisconnectCause()
boolean setExceptionBreakpoint(String exceptionClass) throws NoResponseException, NotConnectedException
exceptionClass
- NoResponseException
NotConnectedException
boolean clearExceptionBreakpoint(String exceptionClass) throws NoResponseException, NotConnectedException
exceptionClass
- NoResponseException
NotConnectedException
boolean supportsConcurrency()
#setActiveIsolate(Value)
Isolate[] getWorkers()
Isolate[] refreshWorkers() throws NotSupportedException, NotSuspendedException, NoResponseException, NotConnectedException
IsolateSession getWorkerSession(int isolateId)
void setLauncher(ILauncher launcher)
launcher
- ILauncher instance used to launch & terminate the process.Copyright © 2016 The Apache Software Foundation. All rights reserved.