Browse Source

API documentation debugger updates

* Add documentation for duk_debugger_attach_custom() and
  duk_debugger_notify()

* Change tag from 'debug' to 'debugger'

* Minor additions to other debugger API calls
pull/600/head
Sami Vaarala 9 years ago
parent
commit
4fdee3093c
  1. 13
      website/api/duk_debugger_attach.yaml
  2. 43
      website/api/duk_debugger_attach_custom.yaml
  3. 2
      website/api/duk_debugger_cooperate.yaml
  4. 2
      website/api/duk_debugger_detach.yaml
  5. 43
      website/api/duk_debugger_notify.yaml

13
website/api/duk_debugger_attach.yaml

@ -11,7 +11,8 @@ proto: |
void *udata);
summary: |
<p>Attach a debugger to the Duktape heap. If debugger support is not
<p>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
<a href="https://github.com/svaarala/duktape/blob/master/doc/debugger.rst">debugger.rst</a>
for more information.</p>
@ -21,6 +22,12 @@ summary: |
<code>read_flush_cb</code> and <code>write_flush_cb</code> callbacks are
optional. Unimplemented callbacks are indicated using a <code>NULL</code>.</p>
<div class="note">
The <code><a href="#duk_debugger_attach_custom">duk_debugger_attach_custom()</a></code>
variant accepts an additional callback to support application specific commands
(AppRequest). These two calls will be merged in Duktape 2.x.
</div>
<div class="note">
Since Duktape 1.4.0 the debugger detached callback is allowed to call
<code><a href="#duk_debugger_attach">duk_debugger_attach()</a></code>
@ -40,10 +47,12 @@ example: |
my_udata);
tags:
- debug
- debugger
seealso:
- duk_debugger_attach_custom
- duk_debugger_detach
- duk_debugger_cooperate
- duk_debugger_notify
introduced: 1.2.0

43
website/api/duk_debugger_attach_custom.yaml

@ -0,0 +1,43 @@
name: duk_debugger_attach_custom
proto: |
void duk_debugger_attach_custom(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: |
<p>Same as <code><a href="#duk_debugger_attach">duk_debugger_attach()</a></code>
but has an additional <code>request_cb</code> callback to support application
specific debug commands (AppRequest). The <code>request_cb</code> may also be
NULL to indicate that the application doesn't support AppRequest.</p>
<p>See the debugger documentation for more information and examples on how
to use application specific commands.</p>
example: |
duk_debugger_attach(ctx,
my_read_cb,
my_write_cb,
my_peek_cb,
NULL,
NULL,
my_request_cb,
my_detached_cb,
my_udata);
tags:
- debugger
seealso:
- duk_debugger_attach
- duk_debugger_detach
- duk_debugger_cooperate
- duk_debugger_notify
introduced: 1.5.0

2
website/api/duk_debugger_cooperate.yaml

@ -15,7 +15,7 @@ example: |
duk_debugger_cooperate(ctx);
tags:
- debug
- debugger
seealso:
- duk_debugger_attach

2
website/api/duk_debugger_detach.yaml

@ -13,7 +13,7 @@ example: |
duk_debugger_detach(ctx);
tags:
- debug
- debugger
seealso:
- duk_debugger_attach

43
website/api/duk_debugger_notify.yaml

@ -0,0 +1,43 @@
name: duk_debugger_notify
proto: |
duk_bool_t duk_debugger_notify(duk_context *ctx, duk_idx_t nvalues);
stack: |
[ ... val1! ...! valN! ] -> [ ... ]
summary: |
<p>Send an application specific debugger notify (AppNotify) containing the
<code>nvalues</code> values on the value stack top mapped to debug protocol
dvalues. The return value indicates whether the notify was successfully
sent (non-zero) or not (zero). The <code>nvalues</code> arguments are
always popped off the stack top. The call is a no-op if debugger support
has not been compiled in, or if the debugger is not attached; in both cases
the call will return zero to indicate that the notify was not sent.</p>
<p>See the debugger documentation for more information and examples on how
to use application specific notifications.</p>
example: |
/* Causes the following notify to be sent over the debugger protocol:
*
* NFY AppNotify "BatteryStatus" 740 1000 true EOM
*/
int battery_current = 740;
int battery_limit = 1000;
int battery_charging = 1;
duk_push_string(ctx, "BatteryStatus");
duk_push_int(ctx, battery_current);
duk_push_int(ctx, battery_limit);
duk_push_boolean(ctx, battery_charging);
if (duk_debugger_notify(ctx, 4 /*nvalues*/)) {
printf("battery status notification sent\n");
} else {
printf("battery status notification not sent\n");
}
tags:
- debugger
introduced: 1.5.0
Loading…
Cancel
Save