{"action":"created","comment":{"url":"https://api.github.com/repos/trailofbits/manticore/pulls/comments/118381372","pull_request_review_id":40161953,"id":118381372,"diff_hunk":"@@ -505,7 +537,189 @@ def load_assertions(self, path):\n                     logger.debug(\"Repeated PC in assertions file %s\", path)\n                 self._assertions[pc] = ' '.join(line.split(' ')[1:])\n \n+    def _backup_state_callback(self, state, state_id):\n+        logger.debug(\"Backup state %r\", state_id)\n+\n+    def _restore_state_callback(self, state, state_id):\n+        logger.debug(\"Restore state %r\", state_id)\n+\n+    def _terminate_state_callback(self, state, state_id, ex):\n+        print \"Terminate state\", state.context\n+\n+        logger.info(\"Terminate_state_callback for %d\", state_id)\n+        executor = self._executor\n+        #aggregates state statistics into exceutor statistics. FIXME split\n+        logger.debug(\"Terminate state %r %r \", state, state_id)\n+        state_visited = state.context.get('visited', set())\n+        state_instructions_count = state.context.get('instructions_count', 0)\n+        with self._executor.locked_context() as context:\n+            executor_visited = context.get('visited', set())\n+            context['visited'] = executor_visited.union(state_visited)\n+\n+            executor_instructions_count = context.get('instructions_count', 0)\n+            context['instructions_count'] = executor_instructions_count + state_instructions_count \n+\n+    def _fork_state_callback(self, state, expression, values, policy):\n+        logger.debug(\"About to backup state %r %r %r\", state, expression, values, policy)\n+\n+    def _read_register_callback(self, state, cpu, reg_name, value):\n+        logger.debug(\"Read Register %r %r\", reg_name, value)\n+\n+    def _write_register_callback(self, state, cpu, reg_name, value):\n+        logger.debug(\"Write Register %r %r\", reg_name, value)\n+\n+    def _read_memory_callback(self, state, cpu, address, value, size):\n+        logger.debug(\"Read Memory %r %r %r\", address, value, size)\n+\n+    def _write_memory_callback(self, state, cpu, address, value, size):\n+        logger.debug(\"Write Memory %r %r %r\", address, value, size)\n \n+    def _decode_instruction_callback(self, state, cpu):\n+        logger.debug(\"Decoding stuff instruction not available\")\n+\n+\n+    def _emulate_instruction_callback(self, state, cpu, instruction):\n+        logger.debug(\"About to emulate instruction\")\n+\n+    def _did_execute_instruction_callback(self, state, cpu, instruction):\n+        logger.debug(\"Did execute an instruction\")\n+\n+    def _execute_instruction_callback(self, state, cpu, instruction):\n+        logger.info(\"exe\\n\")","path":"manticore/manticore.py","position":272,"original_position":272,"commit_id":"70c6e2e8ee14ec80393e18b0587b073c7757a716","original_commit_id":"70c6e2e8ee14ec80393e18b0587b073c7757a716","user":{"login":"mossberg","id":2467355,"avatar_url":"https://avatars2.githubusercontent.com/u/2467355?v=3","gravatar_id":"","url":"https://api.github.com/users/mossberg","html_url":"https://github.com/mossberg","followers_url":"https://api.github.com/users/mossberg/followers","following_url":"https://api.github.com/users/mossberg/following{/other_user}","gists_url":"https://api.github.com/users/mossberg/gists{/gist_id}","starred_url":"https://api.github.com/users/mossberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossberg/subscriptions","organizations_url":"https://api.github.com/users/mossberg/orgs","repos_url":"https://api.github.com/users/mossberg/repos","events_url":"https://api.github.com/users/mossberg/events{/privacy}","received_events_url":"https://api.github.com/users/mossberg/received_events","type":"User","site_admin":false},"body":"i don't think this is a useful logging statement?","created_at":"2017-05-24T22:34:05Z","updated_at":"2017-05-24T22:48:00Z","html_url":"https://github.com/trailofbits/manticore/pull/241#discussion_r118381372","pull_request_url":"https://api.github.com/repos/trailofbits/manticore/pulls/241","_links":{"self":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/comments/118381372"},"html":{"href":"https://github.com/trailofbits/manticore/pull/241#discussion_r118381372"},"pull_request":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/241"}}},"pull_request":{"url":"https://api.github.com/repos/trailofbits/manticore/pulls/241","id":119761614,"html_url":"https://github.com/trailofbits/manticore/pull/241","diff_url":"https://github.com/trailofbits/manticore/pull/241.diff","patch_url":"https://github.com/trailofbits/manticore/pull/241.patch","issue_url":"https://api.github.com/repos/trailofbits/manticore/issues/241","number":241,"state":"open","locked":false,"title":"Decouple functionality via events/signals","user":{"login":"feliam","id":1017522,"avatar_url":"https://avatars2.githubusercontent.com/u/1017522?v=3","gravatar_id":"","url":"https://api.github.com/users/feliam","html_url":"https://github.com/feliam","followers_url":"https://api.github.com/users/feliam/followers","following_url":"https://api.github.com/users/feliam/following{/other_user}","gists_url":"https://api.github.com/users/feliam/gists{/gist_id}","starred_url":"https://api.github.com/users/feliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feliam/subscriptions","organizations_url":"https://api.github.com/users/feliam/orgs","repos_url":"https://api.github.com/users/feliam/repos","events_url":"https://api.github.com/users/feliam/events{/privacy}","received_events_url":"https://api.github.com/users/feliam/received_events","type":"User","site_admin":false},"body":"WIP WIP WIP\r\n* Executor.py refactor\r\n* State search policy decoupled to its own class. Policy() So far only Random() is implemented\r\n* Executor fully equipped with events. Main responsibilities: \r\n     - backup/restore states from _storage_\r\n     - assign id numbers to new states and testcases\r\n     - report all kid of events via signals\r\n* abstractcpu now signals decode and execute as separated events\r\n* Manticore object now needs to hook on some of the new events to generate testcases and others\r\n* mappings.py moved to utils were it belongs. Yes mappings you belong there.","created_at":"2017-05-09T21:48:04Z","updated_at":"2017-05-24T22:48:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10b30249b13bf40768382a961c2f8807387dba21","assignee":{"login":"mossberg","id":2467355,"avatar_url":"https://avatars2.githubusercontent.com/u/2467355?v=3","gravatar_id":"","url":"https://api.github.com/users/mossberg","html_url":"https://github.com/mossberg","followers_url":"https://api.github.com/users/mossberg/followers","following_url":"https://api.github.com/users/mossberg/following{/other_user}","gists_url":"https://api.github.com/users/mossberg/gists{/gist_id}","starred_url":"https://api.github.com/users/mossberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossberg/subscriptions","organizations_url":"https://api.github.com/users/mossberg/orgs","repos_url":"https://api.github.com/users/mossberg/repos","events_url":"https://api.github.com/users/mossberg/events{/privacy}","received_events_url":"https://api.github.com/users/mossberg/received_events","type":"User","site_admin":false},"assignees":[{"login":"mossberg","id":2467355,"avatar_url":"https://avatars2.githubusercontent.com/u/2467355?v=3","gravatar_id":"","url":"https://api.github.com/users/mossberg","html_url":"https://github.com/mossberg","followers_url":"https://api.github.com/users/mossberg/followers","following_url":"https://api.github.com/users/mossberg/following{/other_user}","gists_url":"https://api.github.com/users/mossberg/gists{/gist_id}","starred_url":"https://api.github.com/users/mossberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossberg/subscriptions","organizations_url":"https://api.github.com/users/mossberg/orgs","repos_url":"https://api.github.com/users/mossberg/repos","events_url":"https://api.github.com/users/mossberg/events{/privacy}","received_events_url":"https://api.github.com/users/mossberg/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/trailofbits/manticore/pulls/241/commits","review_comments_url":"https://api.github.com/repos/trailofbits/manticore/pulls/241/comments","review_comment_url":"https://api.github.com/repos/trailofbits/manticore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trailofbits/manticore/issues/241/comments","statuses_url":"https://api.github.com/repos/trailofbits/manticore/statuses/70c6e2e8ee14ec80393e18b0587b073c7757a716","head":{"label":"trailofbits:dev-events","ref":"dev-events","sha":"70c6e2e8ee14ec80393e18b0587b073c7757a716","user":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars3.githubusercontent.com/u/2314423?v=3","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"repo":{"id":81612762,"name":"manticore","full_name":"trailofbits/manticore","owner":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars3.githubusercontent.com/u/2314423?v=3","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trailofbits/manticore","description":"Dynamic binary analysis tool","fork":false,"url":"https://api.github.com/repos/trailofbits/manticore","forks_url":"https://api.github.com/repos/trailofbits/manticore/forks","keys_url":"https://api.github.com/repos/trailofbits/manticore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trailofbits/manticore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trailofbits/manticore/teams","hooks_url":"https://api.github.com/repos/trailofbits/manticore/hooks","issue_events_url":"https://api.github.com/repos/trailofbits/manticore/issues/events{/number}","events_url":"https://api.github.com/repos/trailofbits/manticore/events","assignees_url":"https://api.github.com/repos/trailofbits/manticore/assignees{/user}","branches_url":"https://api.github.com/repos/trailofbits/manticore/branches{/branch}","tags_url":"https://api.github.com/repos/trailofbits/manticore/tags","blobs_url":"https://api.github.com/repos/trailofbits/manticore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trailofbits/manticore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trailofbits/manticore/git/refs{/sha}","trees_url":"https://api.github.com/repos/trailofbits/manticore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trailofbits/manticore/statuses/{sha}","languages_url":"https://api.github.com/repos/trailofbits/manticore/languages","stargazers_url":"https://api.github.com/repos/trailofbits/manticore/stargazers","contributors_url":"https://api.github.com/repos/trailofbits/manticore/contributors","subscribers_url":"https://api.github.com/repos/trailofbits/manticore/subscribers","subscription_url":"https://api.github.com/repos/trailofbits/manticore/subscription","commits_url":"https://api.github.com/repos/trailofbits/manticore/commits{/sha}","git_commits_url":"https://api.github.com/repos/trailofbits/manticore/git/commits{/sha}","comments_url":"https://api.github.com/repos/trailofbits/manticore/comments{/number}","issue_comment_url":"https://api.github.com/repos/trailofbits/manticore/issues/comments{/number}","contents_url":"https://api.github.com/repos/trailofbits/manticore/contents/{+path}","compare_url":"https://api.github.com/repos/trailofbits/manticore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trailofbits/manticore/merges","archive_url":"https://api.github.com/repos/trailofbits/manticore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trailofbits/manticore/downloads","issues_url":"https://api.github.com/repos/trailofbits/manticore/issues{/number}","pulls_url":"https://api.github.com/repos/trailofbits/manticore/pulls{/number}","milestones_url":"https://api.github.com/repos/trailofbits/manticore/milestones{/number}","notifications_url":"https://api.github.com/repos/trailofbits/manticore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trailofbits/manticore/labels{/name}","releases_url":"https://api.github.com/repos/trailofbits/manticore/releases{/id}","deployments_url":"https://api.github.com/repos/trailofbits/manticore/deployments","created_at":"2017-02-10T22:28:34Z","updated_at":"2017-05-24T10:40:51Z","pushed_at":"2017-05-24T21:49:37Z","git_url":"git://github.com/trailofbits/manticore.git","ssh_url":"git@github.com:trailofbits/manticore.git","clone_url":"https://github.com/trailofbits/manticore.git","svn_url":"https://github.com/trailofbits/manticore","homepage":"https://blog.trailofbits.com/2017/04/27/manticore-symbolic-execution-for-humans/","size":10856,"stargazers_count":570,"watchers_count":570,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":57,"forks":59,"open_issues":57,"watchers":570,"default_branch":"master"}},"base":{"label":"trailofbits:master","ref":"master","sha":"e5aca50e1f725ae62f9c9c9af4b413dbc50c9c98","user":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars3.githubusercontent.com/u/2314423?v=3","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"repo":{"id":81612762,"name":"manticore","full_name":"trailofbits/manticore","owner":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars3.githubusercontent.com/u/2314423?v=3","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trailofbits/manticore","description":"Dynamic binary analysis tool","fork":false,"url":"https://api.github.com/repos/trailofbits/manticore","forks_url":"https://api.github.com/repos/trailofbits/manticore/forks","keys_url":"https://api.github.com/repos/trailofbits/manticore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trailofbits/manticore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trailofbits/manticore/teams","hooks_url":"https://api.github.com/repos/trailofbits/manticore/hooks","issue_events_url":"https://api.github.com/repos/trailofbits/manticore/issues/events{/number}","events_url":"https://api.github.com/repos/trailofbits/manticore/events","assignees_url":"https://api.github.com/repos/trailofbits/manticore/assignees{/user}","branches_url":"https://api.github.com/repos/trailofbits/manticore/branches{/branch}","tags_url":"https://api.github.com/repos/trailofbits/manticore/tags","blobs_url":"https://api.github.com/repos/trailofbits/manticore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trailofbits/manticore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trailofbits/manticore/git/refs{/sha}","trees_url":"https://api.github.com/repos/trailofbits/manticore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trailofbits/manticore/statuses/{sha}","languages_url":"https://api.github.com/repos/trailofbits/manticore/languages","stargazers_url":"https://api.github.com/repos/trailofbits/manticore/stargazers","contributors_url":"https://api.github.com/repos/trailofbits/manticore/contributors","subscribers_url":"https://api.github.com/repos/trailofbits/manticore/subscribers","subscription_url":"https://api.github.com/repos/trailofbits/manticore/subscription","commits_url":"https://api.github.com/repos/trailofbits/manticore/commits{/sha}","git_commits_url":"https://api.github.com/repos/trailofbits/manticore/git/commits{/sha}","comments_url":"https://api.github.com/repos/trailofbits/manticore/comments{/number}","issue_comment_url":"https://api.github.com/repos/trailofbits/manticore/issues/comments{/number}","contents_url":"https://api.github.com/repos/trailofbits/manticore/contents/{+path}","compare_url":"https://api.github.com/repos/trailofbits/manticore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trailofbits/manticore/merges","archive_url":"https://api.github.com/repos/trailofbits/manticore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trailofbits/manticore/downloads","issues_url":"https://api.github.com/repos/trailofbits/manticore/issues{/number}","pulls_url":"https://api.github.com/repos/trailofbits/manticore/pulls{/number}","milestones_url":"https://api.github.com/repos/trailofbits/manticore/milestones{/number}","notifications_url":"https://api.github.com/repos/trailofbits/manticore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trailofbits/manticore/labels{/name}","releases_url":"https://api.github.com/repos/trailofbits/manticore/releases{/id}","deployments_url":"https://api.github.com/repos/trailofbits/manticore/deployments","created_at":"2017-02-10T22:28:34Z","updated_at":"2017-05-24T10:40:51Z","pushed_at":"2017-05-24T21:49:37Z","git_url":"git://github.com/trailofbits/manticore.git","ssh_url":"git@github.com:trailofbits/manticore.git","clone_url":"https://github.com/trailofbits/manticore.git","svn_url":"https://github.com/trailofbits/manticore","homepage":"https://blog.trailofbits.com/2017/04/27/manticore-symbolic-execution-for-humans/","size":10856,"stargazers_count":570,"watchers_count":570,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":59,"mirror_url":null,"open_issues_count":57,"forks":59,"open_issues":57,"watchers":570,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/241"},"html":{"href":"https://github.com/trailofbits/manticore/pull/241"},"issue":{"href":"https://api.github.com/repos/trailofbits/manticore/issues/241"},"comments":{"href":"https://api.github.com/repos/trailofbits/manticore/issues/241/comments"},"review_comments":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/241/comments"},"review_comment":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/241/commits"},"statuses":{"href":"https://api.github.com/repos/trailofbits/manticore/statuses/70c6e2e8ee14ec80393e18b0587b073c7757a716"}}}}
{"actor":{"display_login":"mossberg"}}