The target can call duk_debugger_pause() to initiate an immediate
debugger pause, enabling implementation of a "break into debuggeer now"
hotkey or similar mechanism.
The missing 'else' caused no issues without pointer compression because the
external and dynamic buffer variants have an identical layout without pointer
compression.
However, with pointer compression enabled an external buffer is only allocated
the space needed by a dynamic buffer which is smaller with pointer compression
enabled. Memory unsafe behavior results.
Fix the missing 'else'.
* GetBytecode defaults to callstack top as before, with the small change
that a missing callstack top (empty callstack) results in an error instead
of a dummy fake response.
* GetBytecode also accepts a callstack index (-1...-N) and an object/heap
target pointer.
* Fix minor bugs in duk_debug_read_tval() call sites: they assumed that a
duk_tval was pushed even when the read failed and nothing was pushed.
The fix is to stop processing an inbound message if duk_debug_read_tval()
fails and avoid making assumptions about value stack shape.
Add more flexibility to the debugger JSON mapping so that you can giver a
numbered command/notify using the 'request' or 'notify' key directlty,
without having to provide e.g. { "request": true, "command": 123 }. Instead
you can just use { "request" : 123 }.
* Add 'at foo' to indicate function name
* Put file/line into parentheses for better readability
* Use [anon] for anymous functions, which is better than an empty string but
distinguishable from a function actually named 'anon'
* Rename tailcalled flag to tailcall
* Switch from tab indent to 4 space indent
Website debugger section updates:
* Bullet list for debugger features, including AppRequest and
AppNotify
* Emphasize mixing and matching debug clients and targets
* Add documentation for duk_debugger_attach_custom() and
duk_debugger_notify()
* Change tag from 'debug' to 'debugger'
* Minor additions to other debugger API calls
* Add AppRequest example with "CommandLine" custom command which provides
the C argv[].
* Add AppNotify example with "DebuggerHandleFile" custom notify when running
code from files.
* Mention application-defined commands in the introductory overview.
* Add a new section discussing the feature and its usage at length as
well as a recommended convention for messages.
* Document the contract for the request callback and what rules it must
follow. Include a sample request callback implementation.
* Remove future work items covered by this feature.