- JerryScript debugger interface
- Setting up the debugger server
- Integrating debugger support into applications using JerryScript
JerryScript debugger interface
Setting up the debugger server
The following arguments must be passed to
At the moment only a Websocket-based implementation is provided by JerryScript which transmits messages over TCP/IP networks. This implementation requires a socket API which is not yet supported by jerry-libc so the standard libc is used instead. In the future any reliable stream or datagram based protocol can be used for transmitting debugger messages.
The following argument makes JerryScript wait for a client connection:
It is also recommended to increase the log level to see the Waiting for client connection message:
The HTML client can connect to the IP address of the server with
connect command. The IP address can be localhost
if the server and the client are running on the same machine.
After the connection is established the execution can be
controlled by the debugger. The debugger always stops at
the first possible breakpoint location. The effect is the
same as using the
stop command. This allows inserting
breakpoints right before the meaningful part of the execution
All available commands of the client can be queried by the
Integrating debugger support into applications using JerryScript
The debugger can be enabled by passing the
jerry_init () function which then initializes the debugger
and blocks until a client connects.
When the debugger is enabled it is recommended to use
jerry_parse_named_resource () instead of
jerry_parse () because
the resource name (usually a file name) is also passed to this
function. This resource name is used by the client to identify
the corresponding resource. In general it is always recommended to
jerry_parse_named_resource () when the resource name is
available because it silently ignores the resource name if the
debugger is disabled.