Skip to content
Reference > AmiScript API > Classes

Debugger

Definition

Debugger var = .... ;

Extends

Extended By

None

Description

Step-debug control handle for a script target (obtain via a host function, e.g. getDebugger("TIMER:^callback=script")).

Method Summary

Owner Name Return Type Description
Debugger abort() Boolean Halt the session and release it.
Debugger backtrace() List Call-stack frames at the current pause (frame 0 = innermost). Valid only while paused.
Debugger breakAt(line) Map Set a breakpoint at the given 1-based source line (relative to the script body).
Debugger breakpoints() List List the current breakpoints.
Debugger clearBreaks() Boolean Clear all breakpoints.
Debugger deleteBreak(breakpointId) Boolean Delete a breakpoint by id.
Debugger finish() Map Run until the current stack frame returns (step out).
Debugger finish(stepLimit) Map Step out, capping inner steps at stepLimit.
Object getClassName() String Returns the string name of this object's class type.
Debugger getSourceId() String The source id (target) this debugger is attached to.
Debugger locals() List Local variables in the innermost frame. Valid only while paused.
Debugger locals(frameId) List Local variables in the given stack frame. Valid only while paused.
Debugger next() Map Step over the current statement.
Debugger next(stepLimit) Map Step over the current statement, capping inner steps at stepLimit.
Debugger print(expression) Map Evaluate an expression in the innermost frame. Valid only while paused.
Debugger print(expression, frameId) Map Evaluate an expression in the given frame. Valid only while paused.
Debugger resume() Boolean Resume to the next breakpoint.
Debugger run() Map Start the session; pauses at the first breakpoint, or runs to completion if none are set.
Debugger state() Map Current debug state snapshot.
Debugger step() Map Advance one statement (step into).
Object toJson() String Returns a string of a json representation of this object.
Debugger until(line) Map Continue stepping until paused on the given 1-based line.
Debugger until(line, stepLimit) Map Continue stepping until the given line, capping inner steps at stepLimit.

Method Definitions


abort()

Boolean Debugger::abort()

Description

Halt the session and release it.


backtrace()

List Debugger::backtrace()

Description

Call-stack frames at the current pause (frame 0 = innermost). Valid only while paused.


breakAt(line)

Map Debugger::breakAt(Number line)

Description

Set a breakpoint at the given 1-based source line (relative to the script body).

Parameter Definition

Name Type Description
line Number 

breakpoints()

List Debugger::breakpoints()

Description

List the current breakpoints.


clearBreaks()

Boolean Debugger::clearBreaks()

Description

Clear all breakpoints.


deleteBreak(breakpointId)

Boolean Debugger::deleteBreak(Number breakpointId)

Description

Delete a breakpoint by id.

Parameter Definition

Name Type Description
breakpointId Number 

finish()

Map Debugger::finish()

Description

Run until the current stack frame returns (step out).


finish(stepLimit)

Map Debugger::finish(Number stepLimit)

Description

Step out, capping inner steps at stepLimit.

Parameter Definition

Name Type Description
stepLimit Number 

getClassName()

String Object::getClassName()

Description

Returns the string name of this object's class type.


getSourceId()

String Debugger::getSourceId()

Description

The source id (target) this debugger is attached to.


locals()

List Debugger::locals()

Description

Local variables in the innermost frame. Valid only while paused.


locals(frameId)

List Debugger::locals(Number frameId)

Description

Local variables in the given stack frame. Valid only while paused.

Parameter Definition

Name Type Description
frameId Number 

next()

Map Debugger::next()

Description

Step over the current statement.


next(stepLimit)

Map Debugger::next(Number stepLimit)

Description

Step over the current statement, capping inner steps at stepLimit.

Parameter Definition

Name Type Description
stepLimit Number 

print(expression)

Map Debugger::print(String expression)

Description

Evaluate an expression in the innermost frame. Valid only while paused.

Parameter Definition

Name Type Description
expression String 

print(expression,frameId)

Map Debugger::print(String expression, Number frameId)

Description

Evaluate an expression in the given frame. Valid only while paused.

Parameter Definition

Name Type Description
expression String 
frameId Number 

resume()

Boolean Debugger::resume()

Description

Resume to the next breakpoint.


run()

Map Debugger::run()

Description

Start the session; pauses at the first breakpoint, or runs to completion if none are set.


state()

Map Debugger::state()

Description

Current debug state snapshot.


step()

Map Debugger::step()

Description

Advance one statement (step into).


toJson()

String Object::toJson()

Description

Returns a string of a json representation of this object.


until(line)

Map Debugger::until(Number line)

Description

Continue stepping until paused on the given 1-based line.

Parameter Definition

Name Type Description
line Number 

until(line,stepLimit)

Map Debugger::until(Number line, Number stepLimit)

Description

Continue stepping until the given line, capping inner steps at stepLimit.

Parameter Definition

Name Type Description
line Number 
stepLimit Number