name: duk_debugger_attach proto: | void duk_debugger_attach(duk_context *ctx, duk_debug_read_function read_cb, duk_debug_write_function write_cb, duk_debug_peek_function peek_cb, duk_debug_read_flush_function read_flush_cb, duk_debug_write_flush_function write_flush_cb, duk_debug_request_function request_cb, duk_debug_detached_function detached_cb, void *udata); summary: |
Attach a debugger to the Duktape heap. The debugger will automatically
enter paused state when the attach is complete. If debugger support is not
compiled into Duktape, throws an error. See
debugger.rst
for more information on debugger integration. The callbacks are as follows,
optional callbacks may be NULL
:
Callback | Required | Description |
---|---|---|
read_cb | Yes | Debug transport read callback |
write_cb | Yes | Debug transport write callback |
peek_cb | No | Debug transport peek callback, strongly recommended but optional |
read_flush_cb | No | Debug transport read flush callback |
write_flush_cb | No | Debug transport write flush callback |
request_cb | No | Application specific command (AppRequest) callback, NULL indicates no AppRequest support |
detached_cb | No | Debugger detached callback |
Important: The callbacks are not allowed to call any Duktape API functions (doing so may cause memory unsafe behavior) except for the following:
request_cb
AppRequest callback may use the value stack
within the guidelines described in
debugger.rst.duk_debugger_attach()
to immediately reattach the debugger. In Duktape 1.3.0 and before the
immediate reattach potentially caused
some issues.duk_debugger_attach_custom()
and duk_debugger_attach()
API calls were merged in Duktape 2.x.