Debug
Description
The Debug class provides methods that aid in debugging a %Loom %Application.
API overview
Constructor
Debug
()
Attributes
Public attributes
| assertEventDelegate: NativeDelegate | static native |
| assertion: Boolean |
static
native
When set, we have hit a fatal assertion and while we can inspect the program state under the debugger, we cannot continue execution |
| blocking: Boolean |
static
native
When this is true, the debugger coroutine will block the main application code (for hitting breakpoints, stepping code, etc) |
| callEventDelegate: NativeDelegate | static native |
| debugBreak: Boolean | static native |
| finishMethod: MethodBase | static native |
| lineEventDelegate: NativeDelegate |
static
native
Delegates for line, return, call, and assert events |
| returnEventDelegate: NativeDelegate | static native |
| stepOver: Boolean |
static
native
When true, we are stepping over code |
| stepping: Boolean |
static
native
When true, we are stepping code |
Functions
Public functions
| addBreakpoint ( source: String , line: Number ): String |
static native Adds a breakpoint at the given source and line number |
| assert ( expression: Object , message: String = ): Void |
static native Perform an assertion check on a loomscript expression or Object |
| assertException ( e: Error ): Void |
static Internally called to handle a throw keyword |
| debug ( expression: Object = false ): Void |
static Perform a debugger break if supplied expression fails |
| dump ( obj: Object ): Void | static native |
| getBreakpoints (): Vector.<Breakpoint> |
static native Retrieves current breakpoints |
| getCallStack (): Vector.<CallStackInfo> |
static native Retrieves the current function call stack in the form of a Vector of CallStackInfo objects with the first element being the latest call and the last one being the originating enter point |
| getLocals ( snapshot: Vector.<CallStackInfo> , stackLevel: Number ): Dictionary.<String, Object> |
static native Retrieves the locals of the given stack index |
| hasBreakpoint ( source: String , line: Number ): Boolean |
static native Checks if there is a breakpoint at the given source and line |
| print ( message: String ): Void | static |
| removeAllBreakpoints (): Void |
static native Removes all breakpoints |
| removeBreakpoint ( source: String , line: Number ): String |
static native Removes a breakpoint at the given source and line number |
| removeBreakpointAtIndex ( index: Number ): Boolean |
static native Removes a breakpoint at the given index |
| setDebugHook (): Void |
static native Initializes the Lua VM debug hook |
Constructor
Debug ()
Attributes
assertEventDelegate: NativeDelegate
static native
assertion: Boolean
static native
When set, we have hit a fatal assertion and while we can inspect the program state under the debugger, we cannot continue execution.
blocking: Boolean
static native
When this is true, the debugger coroutine will block the main application code (for hitting breakpoints, stepping code, etc).
callEventDelegate: NativeDelegate
static native
debugBreak: Boolean
static native
finishMethod: MethodBase
static native
lineEventDelegate: NativeDelegate
static native
Delegates for line, return, call, and assert events.
returnEventDelegate: NativeDelegate
static native
Functions
addBreakpoint ( source: String , line: Number ): String
static native
Adds a breakpoint at the given source and line number.
Returns the expanded source path.
Parameters
| source: String | |
| line: Number |
assert ( expression: Object , message: String = ): Void
static native
Perform an assertion check on a loomscript expression or Object.
Parameters
| expression: Object | The object to be asserted. |
| message: String = | The message to print if the assertion fails. |
assertException ( e: Error ): Void
static
Internally called to handle a throw keyword.
Parameters
| e: Error |
debug ( expression: Object = false ): Void
static
Perform a debugger break if supplied expression fails
Parameters
| expression: Object = false | The object to be tested. |
getCallStack (): Vector.<CallStackInfo>
static native
Retrieves the current function call stack in the form of a Vector of CallStackInfo objects with the first element being the latest call and the last one being the originating enter point.
See also:
system.CallStackInfo
getFullTypeName
(): String
Inherited from Object
native
Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.
Returns
| String | fully qualified type name of the Object. |
getLocals ( snapshot: Vector.<CallStackInfo> , stackLevel: Number ): Dictionary.<String, Object>
static native
Retrieves the locals of the given stack index.
Parameters
| snapshot: Vector.<CallStackInfo> | |
| stackLevel: Number |
getType
(): Type
Inherited from Object
native
Gets the Type that describes the Object.
Returns
| Type | The Type that describes the object. |
getTypeName
(): String
Inherited from Object
native
Gets the type name of the Object.
Returns
| String | type name of the Object. |
hasBreakpoint ( source: String , line: Number ): Boolean
static native
Checks if there is a breakpoint at the given source and line.
Parameters
| source: String | |
| line: Number |
removeBreakpoint ( source: String , line: Number ): String
static native
Removes a breakpoint at the given source and line number.
Returns the expanded source path.
Parameters
| source: String | |
| line: Number |
removeBreakpointAtIndex ( index: Number ): Boolean
static native
Removes a breakpoint at the given index.
Returns the expanded source path.
Parameters
| index: Number |
setDebugHook (): Void
static native
Initializes the Lua VM debug hook. At this point, we are running under the debugger.