public class DebugCLI extends Object implements Runnable, SourceLocator
This tool utilizes the Debugger Java API (DJAPI) for Flash Player that exists in flash.tools.debuggger.
This tool is not completely compliant with the API, since some commands expose implementation specific information for debugging purposes. Instances where this occurs are kept to a minimum and are isolated in a special class called Extensions. If you wish to build a version that is completely API compatible. Replace Extensions with ExtensionsDisabled in the static method calls at the end of this file.
Modifier and Type | Class and Description |
---|---|
static class |
DebugCLI.InitialPromptState |
Modifier and Type | Field and Description |
---|---|
static int |
CMD_AWATCH |
static int |
CMD_BREAK |
static int |
CMD_CATCH |
static int |
CMD_CF |
static int |
CMD_CLEAR |
static int |
CMD_COMMANDS |
static int |
CMD_COMMENT |
static int |
CMD_CONDITION |
static int |
CMD_CONNECT |
static int |
CMD_CONTINUE |
static int |
CMD_DELETE |
static int |
CMD_DIRECTORY |
static int |
CMD_DISABLE |
static int |
CMD_DISASSEMBLE |
static int |
CMD_DISPLAY |
static int |
CMD_DOWN |
static int |
CMD_ENABLE |
static int |
CMD_FILE |
static int |
CMD_FINISH |
static int |
CMD_FRAME |
static int |
CMD_HALT |
static int |
CMD_HANDLE |
static int |
CMD_HELP |
static int |
CMD_HOME |
static int |
CMD_INFO |
static int |
CMD_KILL |
static int |
CMD_LIST |
static int |
CMD_MCTREE |
static int |
CMD_NEXT |
static int |
CMD_PRINT |
static int |
CMD_PWD |
static int |
CMD_QUIT |
static int |
CMD_RUN |
static int |
CMD_RWATCH |
static int |
CMD_SET |
static int |
CMD_SHOW |
static int |
CMD_SOURCE |
static int |
CMD_STEP |
static int |
CMD_TUTORIAL |
static int |
CMD_UNDISPLAY |
static int |
CMD_UNKNOWN |
static int |
CMD_UP |
static int |
CMD_VIEW_SWF |
static int |
CMD_WATCH |
static int |
CMD_WHAT |
static int |
CMD_WORKER |
static String |
DISPLAY_ATTRIBUTES
Whether the "print" command will display attributes of members.
|
static String |
DISPLAY_FRAME_NUMBER
The current frame we are viewing -- controlled by the "up", "down", and "frame" commands.
|
static int |
ENABLE_ONCE_CMD |
static int |
INFO_ARGS_CMD |
static int |
INFO_BREAK_CMD |
static int |
INFO_DISPLAY_CMD |
static int |
INFO_FILES_CMD |
static int |
INFO_FUNCTIONS_CMD |
static int |
INFO_HANDLE_CMD |
static int |
INFO_LOCALS_CMD |
static int |
INFO_SCOPECHAIN_CMD |
static int |
INFO_SOURCES_CMD |
static int |
INFO_STACK_CMD |
static int |
INFO_SWFS_CMD |
static int |
INFO_TARGETS_CMD |
static int |
INFO_UNKNOWN_CMD |
static int |
INFO_VARIABLES_CMD |
static int |
INFO_WORKERS_CMD |
static String |
LIST_LINE
The line number at which the next "list" command should begin if no
line number is explicitly specified.
|
static String |
LIST_MODULE
The module that the next "list" command should display if no
module is explicitly specified.
|
static String |
LIST_WORKER |
PrintStream |
m_err |
LineNumberReader |
m_keyboardStream |
static String |
m_newline |
PrintStream |
m_out |
String |
m_repeatLine |
static int |
METADATA_RETRIES |
static int |
SHOW_BREAK_CMD |
static int |
SHOW_DIRS_CMD |
static int |
SHOW_FILES_CMD |
static int |
SHOW_FUNC_CMD |
static int |
SHOW_LOC_CMD |
static int |
SHOW_MEM_CMD |
static int |
SHOW_NET_CMD |
static int |
SHOW_PROPERTIES_CMD |
static int |
SHOW_UNKNOWN_CMD |
static int |
SHOW_URI_CMD |
static int |
SHOW_VAR_CMD |
static String |
VERSION |
static boolean |
WORKER_DISPLAY_INTERNAL_SWAP_INFO
Whether the break command will show it changed workers.
|
Constructor and Description |
---|
DebugCLI() |
Modifier and Type | Method and Description |
---|---|
void |
appendReason(StringBuilder sb,
int reason) |
void |
err(String s) |
void |
execute() |
static String |
extractFunctionName(String sig)
extract the function name from a signature
|
int |
getActiveIsolateId() |
int |
getChangeCount()
Returns a number which indicates how many times this SourceLocator's
search algorithm has been changed since it was created.
|
protected String |
getenv(String var) |
FileInfoCache |
getFileCache() |
protected File |
getFlexHomeDirectory()
Returns the Flex home directory.
|
static flash.localization.LocalizationManager |
getLocalizationManager() |
PrintStream |
getOut() |
Session |
getSession() |
boolean |
hasMoreTokens() |
void |
initSourceDirectoriesList() |
boolean |
isIde() |
InputStream |
locateSource(String path,
String pkg,
String name)
Callback from DJAPI to the debugger, to find a source file.
|
static void |
main(String[] args) |
String |
module2ClassName(int moduleId)
Convert a module to class name.
|
int |
nextIntToken() |
long |
nextLongToken() |
String |
nextToken() |
void |
out(String s) |
void |
outputSource(int module,
int line,
String s)
Output a source line of code to the output channel formatting nicely
|
int |
parseFileArg(int isolateId,
int module,
String arg)
Parse arg to determine which file it specifies.
|
int |
parseLineArg(int module,
String arg)
Parse arg to determine which line it specifies.
|
flex.tools.debugger.cli.FileLocation[] |
parseLocationArg(int module,
int line,
String arg) |
flex.tools.debugger.cli.FileLocation[] |
parseLocationArg(int module,
int line,
String arg,
boolean all)
Parse arg to figure out what module and line it specifies.
|
void |
processArgs(String[] args) |
boolean |
processLine()
Process a single line of input and return true if the quit command was encountered
|
int |
propertyGet(String k) |
Set<String> |
propertyKeys() |
void |
propertyPut(String k,
int v) |
void |
pushStream(LineNumberReader r) |
protected String |
readLine()
Dispose of the current line and read the next from the current stream, if its an empty
line and we are console then repeat last line.
|
String |
restOfLine() |
void |
run()
A seperate thread collects our input so that we can
block in the doContinue on the main thread and then
allow the user to interrupt us via keyboard input
on this thread.
|
void |
runningLoop()
Our main loop when the player is off running
|
void |
setCurrentLine(String s) |
public static final String VERSION
public static final int CMD_UNKNOWN
public static final int CMD_QUIT
public static final int CMD_CONTINUE
public static final int CMD_STEP
public static final int CMD_NEXT
public static final int CMD_FINISH
public static final int CMD_BREAK
public static final int CMD_SET
public static final int CMD_LIST
public static final int CMD_PRINT
public static final int CMD_TUTORIAL
public static final int CMD_INFO
public static final int CMD_HOME
public static final int CMD_RUN
public static final int CMD_FILE
public static final int CMD_DELETE
public static final int CMD_SOURCE
public static final int CMD_COMMENT
public static final int CMD_CLEAR
public static final int CMD_HELP
public static final int CMD_SHOW
public static final int CMD_KILL
public static final int CMD_HANDLE
public static final int CMD_ENABLE
public static final int CMD_DISABLE
public static final int CMD_DISPLAY
public static final int CMD_UNDISPLAY
public static final int CMD_COMMANDS
public static final int CMD_PWD
public static final int CMD_CF
public static final int CMD_CONDITION
public static final int CMD_AWATCH
public static final int CMD_WATCH
public static final int CMD_RWATCH
public static final int CMD_WHAT
public static final int CMD_DISASSEMBLE
public static final int CMD_HALT
public static final int CMD_MCTREE
public static final int CMD_VIEW_SWF
public static final int CMD_DOWN
public static final int CMD_UP
public static final int CMD_FRAME
public static final int CMD_DIRECTORY
public static final int CMD_CATCH
public static final int CMD_CONNECT
public static final int CMD_WORKER
public static final int INFO_UNKNOWN_CMD
public static final int INFO_ARGS_CMD
public static final int INFO_BREAK_CMD
public static final int INFO_FILES_CMD
public static final int INFO_HANDLE_CMD
public static final int INFO_FUNCTIONS_CMD
public static final int INFO_LOCALS_CMD
public static final int INFO_SCOPECHAIN_CMD
public static final int INFO_SOURCES_CMD
public static final int INFO_STACK_CMD
public static final int INFO_VARIABLES_CMD
public static final int INFO_DISPLAY_CMD
public static final int INFO_TARGETS_CMD
public static final int INFO_SWFS_CMD
public static final int INFO_WORKERS_CMD
public static final int SHOW_UNKNOWN_CMD
public static final int SHOW_NET_CMD
public static final int SHOW_FUNC_CMD
public static final int SHOW_URI_CMD
public static final int SHOW_PROPERTIES_CMD
public static final int SHOW_FILES_CMD
public static final int SHOW_BREAK_CMD
public static final int SHOW_VAR_CMD
public static final int SHOW_MEM_CMD
public static final int SHOW_LOC_CMD
public static final int SHOW_DIRS_CMD
public static final int ENABLE_ONCE_CMD
public static final int METADATA_RETRIES
public static final boolean WORKER_DISPLAY_INTERNAL_SWAP_INFO
public PrintStream m_err
public PrintStream m_out
public static final String m_newline
public LineNumberReader m_keyboardStream
public String m_repeatLine
public static final String LIST_MODULE
public static final String LIST_LINE
public static final String LIST_WORKER
public static final String DISPLAY_FRAME_NUMBER
public static final String DISPLAY_ATTRIBUTES
public int getActiveIsolateId()
public static void main(String[] args)
public static flash.localization.LocalizationManager getLocalizationManager()
public Session getSession()
public FileInfoCache getFileCache()
public boolean isIde()
public String module2ClassName(int moduleId)
public void pushStream(LineNumberReader r)
public void processArgs(String[] args)
protected String readLine() throws IOException
IOException
public void run()
public void setCurrentLine(String s)
public boolean hasMoreTokens()
public String nextToken()
public int nextIntToken() throws NumberFormatException
NumberFormatException
public long nextLongToken() throws NumberFormatException
NumberFormatException
public String restOfLine()
public void execute()
public PrintStream getOut()
public void err(String s)
public void out(String s)
public void propertyPut(String k, int v)
public int propertyGet(String k)
public void appendReason(StringBuilder sb, int reason)
public static String extractFunctionName(String sig)
public void runningLoop() throws NoResponseException, NotConnectedException, SuspendedException, NotSupportedException, NotSuspendedException, IOException
public void outputSource(int module, int line, String s)
public int parseFileArg(int isolateId, int module, String arg) throws ParseException, AmbiguousException, NoMatchException
public int parseLineArg(int module, String arg) throws ParseException, AmbiguousException, NoMatchException
public flex.tools.debugger.cli.FileLocation[] parseLocationArg(int module, int line, String arg) throws ParseException, AmbiguousException, NoMatchException
public flex.tools.debugger.cli.FileLocation[] parseLocationArg(int module, int line, String arg, boolean all) throws ParseException, AmbiguousException, NoMatchException
public InputStream locateSource(String path, String pkg, String name)
SourceLocator
locateSource
in interface SourceLocator
public int getChangeCount()
SourceLocator
getChangeCount
in interface SourceLocator
public void initSourceDirectoriesList()
protected File getFlexHomeDirectory()
application.home
Java system property if present, or the current directory otherwise.
This directory is one up from the "bin" and "lib" directories. For example,
<flexhome>/lib/fdb.jar
can be used to refer to the fdb jar.public boolean processLine() throws IOException, AmbiguousException, PlayerDebugException
Copyright © 2016 The Apache Software Foundation. All rights reserved.