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
|
static Session |
getRaw(Session s)
Returns the raw Session underlying a ThreadSafeSession.
|
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.
|
Object |
getSyncObject() |
static Object |
getSyncObject(Session s) |
String |
getURI()
Returns the URL that identifies this Session.
|
Value |
getValue(long valueId)
From a given value identifier return a Value.
|
Variable[] |
getVariableList()
Deprecated.
|
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.
|
static ThreadSafeSession |
wrap(Object syncObj,
Session session)
Wraps a Session inside a ThreadSafeSession.
|
public static ThreadSafeSession wrap(Object syncObj, Session session)
public static Session getRaw(Session s)
public boolean bind() throws VersionException
Session
bind
in interface Session
VersionException
- connected to Player which does not support all API completelypublic Location clearBreakpoint(Location location) throws NoResponseException, NotConnectedException
Session
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.
clearBreakpoint
in interface Session
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic Watch clearWatch(Watch watch) throws NoResponseException, NotConnectedException
Session
clearWatch
in interface Session
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic Location[] getBreakpointList() throws NoResponseException, NotConnectedException
Session
getBreakpointList
in interface Session
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic int getEventCount()
Session
getEventCount
in interface Session
public Frame[] getFrames() throws NotConnectedException
Session
getFrames
in interface Session
NotConnectedException
- if Player is disconnected from Sessionpublic Process getLaunchProcess()
Session
getLaunchProcess
in interface Session
public int getPreference(String pref) throws NullPointerException
Session
getPreference
in interface Session
pref
- preference name, one of the strings listed in SessionManager
NullPointerException
- if pref does not existSessionManager
public SwfInfo[] getSwfs() throws NoResponseException
Session
getSwfs
in interface Session
NoResponseException
- if times outpublic String getURI()
Session
public Value getValue(long valueId) throws NotSuspendedException, NoResponseException, NotConnectedException
Session
getValue
in interface Session
valueId
- identifier from Value class or
from a call to Value.getId()NotSuspendedException
- if Player is runningNoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic Variable[] getVariableList() throws NotSuspendedException, NoResponseException, NotConnectedException, VersionException
Session
getVariableList
in interface Session
NotSuspendedException
NoResponseException
NotConnectedException
VersionException
Frame.getLocals(flash.tools.debugger.Session)
public Watch[] getWatchList() throws NoResponseException, NotConnectedException
Session
getWatchList
in interface Session
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic boolean isConnected()
Session
isConnected
in interface Session
public boolean isSuspended() throws NotConnectedException
Session
isSuspended
in interface Session
NotConnectedException
- if Player is disconnected from Sessionpublic DebugEvent nextEvent()
Session
public void resume() throws NotSuspendedException, NotConnectedException, NoResponseException
Session
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.
resume
in interface Session
NotSuspendedException
- if Player is already runningNotConnectedException
- if Player is disconnected from SessionNoResponseException
- if times outpublic Location setBreakpoint(int fileId, int lineNum) throws NoResponseException, NotConnectedException
Session
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.
setBreakpoint
in interface Session
NoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic void setPreference(String pref, int value)
Session
setPreference
in interface Session
pref
- preference name, one of the strings listed abovevalue
- value to set for preferencepublic Watch setWatch(Value v, String memberName, int kind) throws NoResponseException, NotConnectedException, NotSupportedException
Session
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.
setWatch
in interface Session
v
- the variable, upon whose member, the watch is to be placed.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
public Watch setWatch(Watch watch) throws NoResponseException, NotConnectedException, NotSupportedException
Session
setWatch
in interface Session
watch
- the watch to enable or disableNoResponseException
NotConnectedException
NotSupportedException
public void stepContinue() throws NotSuspendedException, NoResponseException, NotConnectedException
Session
stepContinue
in interface Session
NotSuspendedException
- if Player is runningNoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic void stepInto() throws NotSuspendedException, NoResponseException, NotConnectedException
Session
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.
stepInto
in interface Session
NotSuspendedException
- if Player is runningNoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic void stepOut() throws NotSuspendedException, NoResponseException, NotConnectedException
Session
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.
stepOut
in interface Session
NotSuspendedException
- if Player is runningNoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic void stepOver() throws NotSuspendedException, NoResponseException, NotConnectedException
Session
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.
stepOver
in interface Session
NotSuspendedException
- if Player is runningNoResponseException
- if times outNotConnectedException
- if Player is disconnected from Sessionpublic void suspend() throws SuspendedException, NotConnectedException, NoResponseException
Session
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.
suspend
in interface Session
SuspendedException
- if Player is already suspendedNotConnectedException
- if Player is disconnected from SessionNoResponseException
- if times outpublic int suspendReason() throws NotConnectedException
Session
suspendReason
in interface Session
NotConnectedException
- if Player is disconnected from Sessionpublic void terminate()
Session
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.
public void unbind()
Session
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.
public void waitForEvent() throws NotConnectedException, InterruptedException
Session
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.
waitForEvent
in interface Session
NotConnectedException
- if Session is disconnected from PlayerInterruptedException
public SourceLocator getSourceLocator()
Session
getSourceLocator
in interface Session
public void setSourceLocator(SourceLocator sourceLocator)
Session
setSourceLocator
in interface Session
public Value callConstructor(String classname, Value[] args) throws PlayerDebugException
Session
callConstructor
in interface Session
PlayerDebugException
public Value callFunction(Value thisObject, String functionName, Value[] args) throws PlayerDebugException
Session
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.callFunction
in interface Session
PlayerDebugException
public Value getGlobal(String name) throws NotSuspendedException, NoResponseException, NotConnectedException
Session
getGlobal
in interface Session
null
if the global does not exist.NotSuspendedException
NoResponseException
NotConnectedException
public void breakOnCaughtExceptions(boolean b) throws NotSupportedException, NoResponseException
Session
breakOnCaughtExceptions
in interface Session
NotSupportedException
- thrown by older players that don't support this feature.NoResponseException
public boolean evalIs(Value value, Value type) throws PlayerDebugException, PlayerFaultException
Session
evalIs
in interface Session
PlayerDebugException
PlayerFaultException
public boolean evalIs(Value value, String type) throws PlayerDebugException, PlayerFaultException
Session
evalIs
in interface Session
PlayerDebugException
PlayerFaultException
public boolean evalInstanceof(Value value, Value type) throws PlayerDebugException, PlayerFaultException
Session
evalInstanceof
in interface Session
PlayerDebugException
PlayerFaultException
public boolean evalInstanceof(Value value, String type) throws PlayerDebugException, PlayerFaultException
Session
evalInstanceof
in interface Session
PlayerDebugException
PlayerFaultException
public boolean evalIn(Value property, Value object) throws PlayerDebugException, PlayerFaultException
Session
evalIn
in interface Session
PlayerDebugException
PlayerFaultException
public Value evalAs(Value value, Value type) throws PlayerDebugException, PlayerFaultException
Session
evalAs
in interface Session
PlayerDebugException
PlayerFaultException
public boolean supportsWatchpoints()
Session
supportsWatchpoints
in interface Session
Session.setWatch(Value, String, int)
public boolean supportsConcurrency()
Session
supportsConcurrency
in interface Session
#setActiveIsolate(Value)
public Exception getDisconnectCause()
Session
getDisconnectCause
in interface Session
public Isolate[] refreshWorkers() throws NotSupportedException, NotSuspendedException, NoResponseException, NotConnectedException
Session
refreshWorkers
in interface Session
NotSupportedException
NotSuspendedException
NoResponseException
NotConnectedException
public Isolate[] getWorkers()
Session
getWorkers
in interface Session
public IsolateSession getWorkerSession(int isolateId)
Session
getWorkerSession
in interface Session
public boolean setExceptionBreakpoint(String exceptionClass) throws NoResponseException, NotConnectedException
Session
setExceptionBreakpoint
in interface Session
NoResponseException
NotConnectedException
public boolean clearExceptionBreakpoint(String exceptionClass) throws NoResponseException, NotConnectedException
Session
clearExceptionBreakpoint
in interface Session
NoResponseException
NotConnectedException
public void setLauncher(ILauncher launcher)
Session
setLauncher
in interface Session
launcher
- ILauncher instance used to launch & terminate the process.public final Object getSyncObject()
Copyright © 2016 The Apache Software Foundation. All rights reserved.