{"action":"created","issue":{"url":"https://api.github.com/repos/svaarala/duktape/issues/576","repository_url":"https://api.github.com/repos/svaarala/duktape","labels_url":"https://api.github.com/repos/svaarala/duktape/issues/576/labels{/name}","comments_url":"https://api.github.com/repos/svaarala/duktape/issues/576/comments","events_url":"https://api.github.com/repos/svaarala/duktape/issues/576/events","html_url":"https://github.com/svaarala/duktape/pull/576","id":131991916,"number":576,"title":"Add support for debugger heap walking","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},"labels":[{"url":"https://api.github.com/repos/svaarala/duktape/labels/debugger","name":"debugger","color":"bfdadc"},{"url":"https://api.github.com/repos/svaarala/duktape/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/svaarala/duktape/milestones/17","html_url":"https://github.com/svaarala/duktape/milestones/v1.5.0","labels_url":"https://api.github.com/repos/svaarala/duktape/milestones/17/labels","id":1305924,"number":17,"title":"v1.5.0","description":"Low memory, ROM builtins","creator":{"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},"open_issues":39,"closed_issues":35,"state":"open","created_at":"2015-09-15T08:22:06Z","updated_at":"2016-02-25T01:14:33Z","due_on":null,"closed_at":null},"comments":214,"created_at":"2016-02-07T17:54:17Z","updated_at":"2016-02-25T02:16:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/svaarala/duktape/pulls/576","html_url":"https://github.com/svaarala/duktape/pull/576","diff_url":"https://github.com/svaarala/duktape/pull/576.diff","patch_url":"https://github.com/svaarala/duktape/pull/576.patch"},"body":"Add support for safe debugger heap walking:\r\n\r\n- Add a primitive to inspect an object and its properties and flags without side effects. This allows the debug client to enumerate properties, look up the prototype chain, walk referenced objects, etc.\r\n- Add a mechanism for some kind of heap locking to avoid garbage collection while walking the heap.\r\n\r\nTasks:\r\n\r\n- [x] Add a new debugger command for inspecting an object\r\n- [x] Add new debugger commands to \"lock\" the heap for walking (see discussion in #358) => For now, uses automatic locking during paused state; future work is to add an explicit GC during paused state if that is necessary for some reason\r\n- [x] Add `sizeof(void *)` to BasicInfo\r\n- [x] Add optional heapptr target to GetBytecode?\r\n- [ ] Debugger protocol documentation\r\n- [ ] Wiki page for debugger heap walking with more verbose discussion and example command sequences - https://github.com/svaarala/duktape-wiki/pull/81\r\n- [ ] Some minimal implementation in the web UI\r\n- [ ] Document garbage collection behavior during paused state into debugger documentation; refzero cases go through mark-and-sweep now\r\n- [ ] Read through debugger.rst and update design notes and future work re: inspect\r\n- [ ] Releases\r\n\r\nLow level issues to resolve:\r\n\r\n- [x] What to do about virtual properties - i.e. properties logically part of the object and visible to Ecmascript code, but not concretely part of the object's internal property table? For comparison, enumeration code needs to \"fake\" these properties. => For now, virtual properties are not returned in inspection; future work.\r\n- [ ] Make the `InspectHeapObject` command optional because of the relatively high footprint.\r\n- [ ] Should property keys be object references to heap strings? If yes, what to do about artificial keys? If no, how would user code be able to dump all heap strings? Should there be a LookupString command to find an interned string?\r\n\r\nConsider overlaps with existing commands:\r\n\r\n- [ ] `InspectHeapObject` and `DumpHeap`: Could DumpHeap simply provide a list of heap pointers which the debug client would then inspect using `InspectHeapObject` so that there'd be no formatting overlap?\r\n- [ ] `InspectHeapObject` and `GetBytecode`: GetBytecode could be replaced by simply getting a reference to the currently executing function and then adding the bytecode, constants, and inner functions into the InspectHeapObject result. There's a small issue in representing structured values there; temporary objects may need to be created to hold the constants, etc.\r\n"},"comment":{"url":"https://api.github.com/repos/svaarala/duktape/issues/comments/188567253","html_url":"https://github.com/svaarala/duktape/pull/576#issuecomment-188567253","issue_url":"https://api.github.com/repos/svaarala/duktape/issues/576","id":188567253,"user":{"login":"harold-b","id":11462418,"avatar_url":"https://avatars.githubusercontent.com/u/11462418?v=3","gravatar_id":"","url":"https://api.github.com/users/harold-b","html_url":"https://github.com/harold-b","followers_url":"https://api.github.com/users/harold-b/followers","following_url":"https://api.github.com/users/harold-b/following{/other_user}","gists_url":"https://api.github.com/users/harold-b/gists{/gist_id}","starred_url":"https://api.github.com/users/harold-b/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harold-b/subscriptions","organizations_url":"https://api.github.com/users/harold-b/orgs","repos_url":"https://api.github.com/users/harold-b/repos","events_url":"https://api.github.com/users/harold-b/events{/privacy}","received_events_url":"https://api.github.com/users/harold-b/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T02:16:45Z","updated_at":"2016-02-25T02:16:45Z","body":"@fatcerberus Thoughts on the solutions @svaarala  provided?"}}