{"action":"created","issue":{"url":"https://api.github.com/repos/svaarala/duktape/issues/596","repository_url":"https://api.github.com/repos/svaarala/duktape","labels_url":"https://api.github.com/repos/svaarala/duktape/issues/596/labels{/name}","comments_url":"https://api.github.com/repos/svaarala/duktape/issues/596/comments","events_url":"https://api.github.com/repos/svaarala/duktape/issues/596/events","html_url":"https://github.com/svaarala/duktape/pull/596","id":134389784,"number":596,"title":"Implement out-of-band debugger commands","user":{"login":"fatcerberus","id":4097841,"avatar_url":"https://avatars.githubusercontent.com/u/4097841?v=3","gravatar_id":"","url":"https://api.github.com/users/fatcerberus","html_url":"https://github.com/fatcerberus","followers_url":"https://api.github.com/users/fatcerberus/followers","following_url":"https://api.github.com/users/fatcerberus/following{/other_user}","gists_url":"https://api.github.com/users/fatcerberus/gists{/gist_id}","starred_url":"https://api.github.com/users/fatcerberus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatcerberus/subscriptions","organizations_url":"https://api.github.com/users/fatcerberus/orgs","repos_url":"https://api.github.com/users/fatcerberus/repos","events_url":"https://api.github.com/users/fatcerberus/events{/privacy}","received_events_url":"https://api.github.com/users/fatcerberus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":32,"created_at":"2016-02-17T20:22:38Z","updated_at":"2016-02-18T16:08:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/svaarala/duktape/pulls/596","html_url":"https://github.com/svaarala/duktape/pull/596","diff_url":"https://github.com/svaarala/duktape/pull/596.diff","patch_url":"https://github.com/svaarala/duktape/pull/596.patch"},"body":"This adds out of band message support for the debug protocol. When Duktape receives a request message beginning `REQ 0xff`, it pushes all the remaining dvalues in the message to the valstack and calls `heap->dbg_oob_cb`.  The callback can push it own values to the stack, and these are sent back to the client as a REP.\r\n\r\nIt is also possible for the target to send out-of-band notifys to the client by calling `duk_debugger_notify()`.\r\n\r\nThis currently represents a breaking API change because it adds an additional callback argument to duk_debugger_attach().  If possible, it would be better to implement this in a way that didn't break the existing API guarantees.\r\n\r\nThis branch is just a prototype right now for the purpose of having something concrete to discuss.  It still needs documentation, and is somewhat messy.  However, initial testing indicates the functionality itself is working as designed."},"comment":{"url":"https://api.github.com/repos/svaarala/duktape/issues/comments/185794186","html_url":"https://github.com/svaarala/duktape/pull/596#issuecomment-185794186","issue_url":"https://api.github.com/repos/svaarala/duktape/issues/596","id":185794186,"user":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T16:08:43Z","updated_at":"2016-02-18T16:08:43Z","body":"Re: heap types, since this is all trusted code, it's probably fine to just document that the types should not be objects etc. Even if they are, that's not an issue by itself as long as the debug client doesn't walk an unsafe pointer. In general the debug client won't know that it's going to be safe but that'll ultimately be up to the debug client.\r\n\r\nAnother option would be to walk through the values and assert for their type mask, so that at least assert builds would flag offending values. This is a bit different from recommending not to use object values of course."}}