{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/chisel/issues/197","repository_url":"https://api.github.com/repos/facebook/chisel","labels_url":"https://api.github.com/repos/facebook/chisel/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/facebook/chisel/issues/197/comments","events_url":"https://api.github.com/repos/facebook/chisel/issues/197/events","html_url":"https://github.com/facebook/chisel/pull/197","id":244940067,"number":197,"title":"Add findinstances, and new support framework in Chisel.xcodeproj","user":{"login":"kastiglione","id":43429,"avatar_url":"https://avatars0.githubusercontent.com/u/43429?v=4","gravatar_id":"","url":"https://api.github.com/users/kastiglione","html_url":"https://github.com/kastiglione","followers_url":"https://api.github.com/users/kastiglione/followers","following_url":"https://api.github.com/users/kastiglione/following{/other_user}","gists_url":"https://api.github.com/users/kastiglione/gists{/gist_id}","starred_url":"https://api.github.com/users/kastiglione/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kastiglione/subscriptions","organizations_url":"https://api.github.com/users/kastiglione/orgs","repos_url":"https://api.github.com/users/kastiglione/repos","events_url":"https://api.github.com/users/kastiglione/events{/privacy}","received_events_url":"https://api.github.com/users/kastiglione/received_events","type":"User","site_admin":false},"labels":[{"id":196857222,"url":"https://api.github.com/repos/facebook/chisel/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-23T22:17:35Z","updated_at":"2017-11-17T07:34:15Z","closed_at":"2017-11-17T07:33:46Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/facebook/chisel/pulls/197","html_url":"https://github.com/facebook/chisel/pull/197","diff_url":"https://github.com/facebook/chisel/pull/197.diff","patch_url":"https://github.com/facebook/chisel/pull/197.patch"},"body":"This adds a new command, `findinstances`, which is implemented mostly in native code and so comes with Chisel.xcodeproj which contains a new Chisel framework. Future Chisel commands can implement the heavy lifing this way too.\r\n\r\nThe `findinstances` command scans the heap using available iOS/macOS malloc API. For each allocation, a number of heuristics are peformed to identify likely Objective-C instances. The heuristics do not call methods on the objects, instead relying only on objc runtime functions to passively match the instance based on its class metadata. This avoids allocations and stateful side effects in the objc runtime.\r\n\r\nAfter this first pass, the candidate objects go through a second pass that checks if they match against an optional `NSPredicate`. If there's no predicate, the object is printed with minimal information. If there is a predicate, and the object passes the predicate, then the object will be printed out with more detail, specifically the detail queried in the predicate.\r\n\r\nSome examples of `findinstances`:\r\n\r\n```\r\nfindinstances UIView\r\nfindinstances *UIView\r\nfindinstances UIScrollViewDelegate\r\nfindinstances UIView window == nil || hidden == true || alpha == 0 || layer.bounds.#size.width == 0 ||  layer.bounds.#size.height == 0 \r\nfindinstances UIView subviews.@count == 0\r\nfindinstances NSDictionary any @allKeys beginswith 'perf_'\r\nfindinstances NSArray @count > 100\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/chisel/issues/comments/345167565","html_url":"https://github.com/facebook/chisel/pull/197#issuecomment-345167565","issue_url":"https://api.github.com/repos/facebook/chisel/issues/197","id":345167565,"user":{"login":"kastiglione","id":43429,"avatar_url":"https://avatars0.githubusercontent.com/u/43429?v=4","gravatar_id":"","url":"https://api.github.com/users/kastiglione","html_url":"https://github.com/kastiglione","followers_url":"https://api.github.com/users/kastiglione/followers","following_url":"https://api.github.com/users/kastiglione/following{/other_user}","gists_url":"https://api.github.com/users/kastiglione/gists{/gist_id}","starred_url":"https://api.github.com/users/kastiglione/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kastiglione/subscriptions","organizations_url":"https://api.github.com/users/kastiglione/orgs","repos_url":"https://api.github.com/users/kastiglione/repos","events_url":"https://api.github.com/users/kastiglione/events{/privacy}","received_events_url":"https://api.github.com/users/kastiglione/received_events","type":"User","site_admin":false},"created_at":"2017-11-17T07:34:15Z","updated_at":"2017-11-17T07:34:15Z","author_association":"MEMBER","body":"I'll be doing follow up pull requests."}}
{"actor":{"display_login":"kastiglione"}}