Enum Command
- java.lang.Object
-
- java.lang.Enum<Command>
-
- ca.cgjennings.apps.arkham.plugins.debugging.Command
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Command>
public enum Command extends java.lang.Enum<Command>
An enumeration of the commands recognized by the network protocol of the default debugger implementation.- Since:
- 3.0
- Author:
- Chris Jennings
- See Also:
DefaultScriptDebugger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BREAK
Break at the next opportunity.BREAKONDEBUGGER
Set break-on-debugger-statement off or on using 0 or 1.BREAKONENTER
Set break-on-enter off or on using 0 or 1.BREAKONEXIT
Set break-on-exit off or on using 0 or 1.BREAKONTHROW
Set break-on-exception off or on using 0 or 1.BREAKPOINTS
Given a script file, get a list of breakable lines.BREAKSTATUS
Returns whether break-on-X is enabled, one per line as 0 or 1.CACHEMETRICS
Returns a list of information about registeredCacheMetrics
instances.CALLSTACK
Returns the current call stack as a sequence of pairs of lines with the format: file, line number.CLEARBREAKPOINTS
Clear all breakpoints in the specified file.CONTINUE
Continue running until the next breakpoint.EVAL
Evaluates an expression in the context of a stack frame, returning the string value of the result.EVAL_DETAILED
Evaluates an expression in the context of a stack frame, returning a more detailed description thanEVAL
.FILELIST
Get a list of all script file names, one per line.INFOTABLE
Returns the serialized form of the namedInfoTable
.INFOTABLELIST
Returns a list of the names of available data tables from the server.INTERRUPTED
Returns 0 or 1 depending on whether a breakpoint has been hit.PROBE
Verify that server is up.SCOPE
Obtain a list of the immediate child properties of an object in scope.SCOPEEVAL
Acts as perSCOPE
, but returns the string representation of the value of the specified object instead of its child properties.SERVERINFO
Returns a description of the server to help tell multiple servers on the same device apart.SOURCE
Given a script file, get the script source code.STEPINTO
Step into functions on the current line.STEPOUT
Step out of the current function.STEPOVER
Step over the current line.STOP
Stop the running script.TOGGLEBREAK
Toggle a breakpoint in the given file and line number.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
escapeHTML(java.lang.String s)
Escapes raw text that will be displayed within HTML content.static java.lang.String
escapeProtocolText(java.lang.String s)
Escape server arguments and responses.int
getArgCount()
Returns the number of arguments required by the command.static java.lang.String
unescapeProtocolText(java.lang.String s)
Converts a string escaped withescapeProtocolText(java.lang.String)
back to the original string.static Command
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Command[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PROBE
public static final Command PROBE
Verify that server is up. Returns a number indicating the number of stack frame updates, which can be polled to determine when a breakpoint changes.
-
SERVERINFO
public static final Command SERVERINFO
Returns a description of the server to help tell multiple servers on the same device apart.
-
STOP
public static final Command STOP
Stop the running script.
-
INTERRUPTED
public static final Command INTERRUPTED
Returns 0 or 1 depending on whether a breakpoint has been hit. If the first line is 1 (indicating that a script is interrupted), then the next two lines will be the name of the interrupted thread and the name of the exception (if any) that caused the interrupt.
-
CONTINUE
public static final Command CONTINUE
Continue running until the next breakpoint.
-
BREAK
public static final Command BREAK
Break at the next opportunity.
-
STEPOVER
public static final Command STEPOVER
Step over the current line.
-
STEPINTO
public static final Command STEPINTO
Step into functions on the current line.
-
STEPOUT
public static final Command STEPOUT
Step out of the current function.
-
FILELIST
public static final Command FILELIST
Get a list of all script file names, one per line.
-
SOURCE
public static final Command SOURCE
Given a script file, get the script source code.
-
BREAKPOINTS
public static final Command BREAKPOINTS
Given a script file, get a list of breakable lines. This is a list of line numbers for which a break is possible, one line number per line. Each line number is followed by another line, either "-" (no break set) or "X" (break set).
-
TOGGLEBREAK
public static final Command TOGGLEBREAK
Toggle a breakpoint in the given file and line number.
-
CLEARBREAKPOINTS
public static final Command CLEARBREAKPOINTS
Clear all breakpoints in the specified file.
-
BREAKONENTER
public static final Command BREAKONENTER
Set break-on-enter off or on using 0 or 1.
-
BREAKONEXIT
public static final Command BREAKONEXIT
Set break-on-exit off or on using 0 or 1.
-
BREAKONTHROW
public static final Command BREAKONTHROW
Set break-on-exception off or on using 0 or 1.
-
BREAKONDEBUGGER
public static final Command BREAKONDEBUGGER
Set break-on-debugger-statement off or on using 0 or 1.
-
BREAKSTATUS
public static final Command BREAKSTATUS
Returns whether break-on-X is enabled, one per line as 0 or 1.
-
CALLSTACK
public static final Command CALLSTACK
Returns the current call stack as a sequence of pairs of lines with the format: file, line number.
-
EVAL
public static final Command EVAL
Evaluates an expression in the context of a stack frame, returning the string value of the result. Can be any string that can be interpreted witheval()
. The first argument is an index indicating the stack frame (0 is the top). The second argument is the expression to evaluate.
-
EVAL_DETAILED
public static final Command EVAL_DETAILED
Evaluates an expression in the context of a stack frame, returning a more detailed description thanEVAL
. Can be any expression. The first argument is an index indicating the stack frame (0 is the top). The second argument is the expression to evaluate.
-
SCOPE
public static final Command SCOPE
Obtain a list of the immediate child properties of an object in scope. The first argument is an index indicating the stack frame (0 is the top). The second argument identifies the object to list the properties of; it is a chain of null-character separated symbols, starting with either<scope>
or<this>
to begin from the local scope or the currentthis
object (respectively).
-
SCOPEEVAL
public static final Command SCOPEEVAL
Acts as perSCOPE
, but returns the string representation of the value of the specified object instead of its child properties.
-
INFOTABLELIST
public static final Command INFOTABLELIST
Returns a list of the names of available data tables from the server. This is a list of all generators registered withTables
, one per line.
-
INFOTABLE
public static final Command INFOTABLE
Returns the serialized form of the namedInfoTable
. The argument is one of the names returned usingINFOTABLELIST
.
-
CACHEMETRICS
public static final Command CACHEMETRICS
Returns a list of information about registeredCacheMetrics
instances. The result consists of one entry per metrics instance. Each entry consists of three lines: the first line is the metric's name, a colon, and its status string, the next is the content type class name, and the last is Y or N as the cache is clearable or not. The command takes a single integer parameter. If the integer value is -1, no additional action is taken. If it is the index of a valid entry in the returned list, then the matching cache will be cleared before returning the list. If the value is -2, all clearable caches are cleared.
-
-
Method Detail
-
values
public static Command[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Command c : Command.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Command valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getArgCount
public int getArgCount()
Returns the number of arguments required by the command.- Returns:
- the arity of this
Command
-
escapeHTML
public static java.lang.String escapeHTML(java.lang.String s)
Escapes raw text that will be displayed within HTML content.- Parameters:
s
- the string to escape- Returns:
- the content of
s
, with the characters <, >, and & converted to the appropriate HTML entity values
-
escapeProtocolText
public static java.lang.String escapeProtocolText(java.lang.String s)
Escape server arguments and responses.- Parameters:
s
- the plain string- Returns:
- an escaped string
-
unescapeProtocolText
public static java.lang.String unescapeProtocolText(java.lang.String s)
Converts a string escaped withescapeProtocolText(java.lang.String)
back to the original string.- Parameters:
s
- the string to convert- Returns:
- the unescaped string
-
-