Debugger

The webOS Debugger is a command-line tool you can use on a webOS device or Emulator that enables you to use breakpoints, display variables, and trace the stack.

Notes:

To start the Debugger:

  1. Open a device shell.

  2. Type "debug" and press "Enter".

Some system messages are displayed, then the Debugger prompt appears.


Commands


Basic Commands
help Shows the available commands.
scripts Shows all of the loaded scripts, including the Mojo framework.
Breakpoints
break script:line
or b script:line
Sets a breakpoint. Specify the full path to the script, and the line number.
Example: b /var/usr/palm/applications/com.yourdomain.test/app/assistants/stage-assistant.js:5
clear ID or delete ID or d ID Clears the breakpoint specified by ID.
cond ID expression Makes the breakpoint specified by ID conditional on an expression. The expression is any boolean JavaScript expression that can be evaluated at the site of the breakpoint. If the expression evaluates to true, the breakpoint triggers. To make the breakpoint unconditional again, type cond ID with no expression.
disable ID or dis ID Disables the breakpoint specified by ID.
enable ID or en ID Enables the breakpoint specified by ID.
ignore ID [count] Ignores the breakpoint specified by ID ( count times, if specified).
info break or inf br Shows the current breakpoints and their ID numbers.
Execution Control
continue or c Continue (run).
finish or fin Step out of the current method.
next or n Step over.
step or s Step into.
Program Stack
backtrace or bt Shows the call stack.
down or do Moves down one frame in the call stack listing.
frame number or f number Goes to the frame number in the call stack listing. If a number is not specified, displays the current frame.
up Moves up one frame in the call stack listing.
Source
list or l Shows the next 10 lines of code.
list - or l - Shows the previous 10 lines of code.
list first, last Shows from line first to line last.
Variables
info args or inf ar Displays the arguments.
info locals or inf lo Displays the values of local variables.
print expression or p expression Executes expression and displays the result. For example, expression might be a variable from the script.
set variable = expression Sets variable to expression.