{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/28437676","id":28437676,"diff_hunk":"@@ -156,6 +163,137 @@ ostream& Assembly::stream(ostream& _out, string const& _prefix, StringMap const&\n \treturn _out;\n }\n \n+Json::Value Assembly::createJsonValue(string _name, int _begin, int _end, string _value, string _jumpType) const\n+{\n+\tJson::Value value;\n+\tvalue[\"name\"] = _name;\n+\tvalue[\"begin\"] = _begin;\n+\tvalue[\"end\"] = _end;\n+\tif (!_value.empty())\n+\t\tvalue[\"value\"] = _value;\n+\tif (!_jumpType.empty())\n+\t\tvalue[\"jumpType\"] = _jumpType;\n+\treturn value;\n+}\n+\n+Json::Value Assembly::streamAsmJson(ostream& _out, string const& _prefix, StringMap const& _sourceCodes, bool _inJsonFormat) const\n+{\n+\tJson::Value root;\n+\n+\tstring currentArrayName = \".code\";\n+\tstd::vector<Json::Value> currentCollection;\n+\tfor (AssemblyItem const& i: m_items)\n+\t{\n+\t\tswitch (i.type())\n+\t\t{\n+\t\tcase Operation:\n+\t\t\tcurrentCollection.push_back(\n+\t\t\t\tcreateJsonValue(instructionInfo(i.instruction()).name, i.getLocation().start, i.getLocation().end, i.getJumpTypeAsString()));\n+\t\t\tbreak;\n+\t\tcase Push:\n+\t\t{\n+\t\t\tstd::stringstream hexStr;\n+\t\t\thexStr << hex << i.data();\n+\t\t\tcurrentCollection.push_back(\n+\t\t\t\tcreateJsonValue(string(\"PUSH\"), i.getLocation().start, i.getLocation().end, hexStr.str(), i.getJumpTypeAsString()));\n+\t\t}\n+\t\t\tbreak;\n+\t\tcase PushString:\n+\t\t\tcurrentCollection.push_back(\n+\t\t\t\tcreateJsonValue(string(\"PUSH tag\"), i.getLocation().start, i.getLocation().end, m_strings.at((h256)i.data())));\n+\t\t\tbreak;\n+\t\tcase PushTag:\n+\t\t{\n+\t\t\tstd::stringstream hexStr;\n+\t\t\thexStr << hex << i.data();\n+\t\t\tcurrentCollection.push_back(\n+\t\t\t\tcreateJsonValue(string(\"PUSH [tag]\"), i.getLocation().start, i.getLocation().end, hexStr.str()));\n+\t\t}\n+\t\t\tbreak;\n+\t\tcase PushSub:\n+\t\t\tcurrentCollection.push_back(\n+\t\t\t\tcreateJsonValue(string(\"PUSH [$]\"), i.getLocation().start, i.getLocation().end, dev::toString(h256(i.data()))));\n+\t\t\tbreak;\n+\t\tcase PushSubSize:\n+\t\t\tcurrentCollection.push_back(\n+\t\t\t\tcreateJsonValue(string(\"PUSH #[$]\"), i.getLocation().start, i.getLocation().end, dev::toString(h256(i.data()))));\n+\t\t\tbreak;\n+\t\tcase PushProgramSize:\n+\t\t\tcurrentCollection.push_back(\n+\t\t\t\tcreateJsonValue(string(\"PUSHSIZE\"), i.getLocation().start, i.getLocation().end));\n+\t\t\tbreak;\n+\t\tcase Tag:\n+\t\t{\n+\t\t\tJson::Value collection(Json::arrayValue);\n+\t\t\tfor (auto it: currentCollection)\n+\t\t\t\tcollection.append(it);\n+\t\t\tcurrentCollection.clear();\n+\t\t\troot[currentArrayName] = collection;\n+\t\t\tcurrentArrayName = \"tag\" + string(i.data());\n+\t\t\tJson::Value jumpdest;\n+\t\t\tjumpdest[\"name\"] = \"JUMDEST\";\n+\t\t\tcurrentCollection.push_back(jumpdest);\n+\t\t}\n+\t\t\tbreak;\n+\t\tcase PushData:\n+\t\t{\n+\t\t\tJson::Value pushData;\n+\t\t\tpushData[\"name\"] = \"PUSH hex\";\n+\t\t\tstd::stringstream hexStr;\n+\t\t\thexStr << hex << i.data();\n+\t\t\tcurrentCollection.push_back(createJsonValue(string(\"PUSH hex\"), i.getLocation().start, i.getLocation().end, hexStr.str()));\n+\t\t}\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tBOOST_THROW_EXCEPTION(InvalidOpcode());\n+\t\t}\n+\t}\n+\n+\tJson::Value collection(Json::arrayValue);\n+\tfor (auto it: currentCollection)\n+\t\tcollection.append(it);\n+\troot[currentArrayName] = collection;\n+\n+\tif (!m_data.empty() || !m_subs.empty())\n+\t{\n+\t\tJson::Value dataCollection(Json::arrayValue);","path":"libevmcore/Assembly.cpp","position":120,"original_position":120,"commit_id":"b11e640665dfe130fc442c955d3d58c114ff45ec","original_commit_id":"b11e640665dfe130fc442c955d3d58c114ff45ec","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars.githubusercontent.com/u/9073706?v=3","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"body":"I think `dataCollection` should be a hashtable whose keys are the keys of m_data (for non-subs) and the indices of the m_subs array for subs.","created_at":"2015-04-15T16:39:49Z","updated_at":"2015-04-15T16:39:49Z","html_url":"https://github.com/ethereum/cpp-ethereum/pull/1604#discussion_r28437676","pull_request_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1604","_links":{"self":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/28437676"},"html":{"href":"https://github.com/ethereum/cpp-ethereum/pull/1604#discussion_r28437676"},"pull_request":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1604"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1604","id":33172044,"html_url":"https://github.com/ethereum/cpp-ethereum/pull/1604","diff_url":"https://github.com/ethereum/cpp-ethereum/pull/1604.diff","patch_url":"https://github.com/ethereum/cpp-ethereum/pull/1604.patch","issue_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/1604","number":1604,"state":"open","locked":false,"title":"Sol machine friendly output","user":{"login":"LianaHus","id":9685356,"avatar_url":"https://avatars.githubusercontent.com/u/9685356?v=3","gravatar_id":"","url":"https://api.github.com/users/LianaHus","html_url":"https://github.com/LianaHus","followers_url":"https://api.github.com/users/LianaHus/followers","following_url":"https://api.github.com/users/LianaHus/following{/other_user}","gists_url":"https://api.github.com/users/LianaHus/gists{/gist_id}","starred_url":"https://api.github.com/users/LianaHus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LianaHus/subscriptions","organizations_url":"https://api.github.com/users/LianaHus/orgs","repos_url":"https://api.github.com/users/LianaHus/repos","events_url":"https://api.github.com/users/LianaHus/events{/privacy}","received_events_url":"https://api.github.com/users/LianaHus/received_events","type":"User","site_admin":false},"body":"in progress","created_at":"2015-04-13T15:05:33Z","updated_at":"2015-04-15T16:39:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96c2f752670298c7bd0ae71be0ac7972a60b70ad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1604/commits","review_comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1604/comments","review_comment_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/1604/comments","statuses_url":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/b11e640665dfe130fc442c955d3d58c114ff45ec","head":{"label":"LianaHus:sol_Machine_friendly_output","ref":"sol_Machine_friendly_output","sha":"b11e640665dfe130fc442c955d3d58c114ff45ec","user":{"login":"LianaHus","id":9685356,"avatar_url":"https://avatars.githubusercontent.com/u/9685356?v=3","gravatar_id":"","url":"https://api.github.com/users/LianaHus","html_url":"https://github.com/LianaHus","followers_url":"https://api.github.com/users/LianaHus/followers","following_url":"https://api.github.com/users/LianaHus/following{/other_user}","gists_url":"https://api.github.com/users/LianaHus/gists{/gist_id}","starred_url":"https://api.github.com/users/LianaHus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LianaHus/subscriptions","organizations_url":"https://api.github.com/users/LianaHus/orgs","repos_url":"https://api.github.com/users/LianaHus/repos","events_url":"https://api.github.com/users/LianaHus/events{/privacy}","received_events_url":"https://api.github.com/users/LianaHus/received_events","type":"User","site_admin":false},"repo":{"id":29241685,"name":"cpp-ethereum","full_name":"LianaHus/cpp-ethereum","owner":{"login":"LianaHus","id":9685356,"avatar_url":"https://avatars.githubusercontent.com/u/9685356?v=3","gravatar_id":"","url":"https://api.github.com/users/LianaHus","html_url":"https://github.com/LianaHus","followers_url":"https://api.github.com/users/LianaHus/followers","following_url":"https://api.github.com/users/LianaHus/following{/other_user}","gists_url":"https://api.github.com/users/LianaHus/gists{/gist_id}","starred_url":"https://api.github.com/users/LianaHus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LianaHus/subscriptions","organizations_url":"https://api.github.com/users/LianaHus/orgs","repos_url":"https://api.github.com/users/LianaHus/repos","events_url":"https://api.github.com/users/LianaHus/events{/privacy}","received_events_url":"https://api.github.com/users/LianaHus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LianaHus/cpp-ethereum","description":"Gavin Wood's C++ implementation of the Ethereum yellowpaper.","fork":true,"url":"https://api.github.com/repos/LianaHus/cpp-ethereum","forks_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/forks","keys_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/teams","hooks_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/hooks","issue_events_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/events","assignees_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/tags","blobs_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/languages","stargazers_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/stargazers","contributors_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/contributors","subscribers_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/subscribers","subscription_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/subscription","commits_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/merges","archive_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/downloads","issues_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/LianaHus/cpp-ethereum/releases{/id}","created_at":"2015-01-14T11:44:38Z","updated_at":"2015-04-09T10:20:32Z","pushed_at":"2015-04-15T13:58:12Z","git_url":"git://github.com/LianaHus/cpp-ethereum.git","ssh_url":"git@github.com:LianaHus/cpp-ethereum.git","clone_url":"https://github.com/LianaHus/cpp-ethereum.git","svn_url":"https://github.com/LianaHus/cpp-ethereum","homepage":"www.gavwood.com/Paper.pdf","size":19993,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"b077d09859445af98eff0c6ffcc5f5331b2e9b6e","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":15460666,"name":"cpp-ethereum","full_name":"ethereum/cpp-ethereum","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/cpp-ethereum","description":"Gavin Wood's C++ implementation of the Ethereum yellowpaper.","fork":false,"url":"https://api.github.com/repos/ethereum/cpp-ethereum","forks_url":"https://api.github.com/repos/ethereum/cpp-ethereum/forks","keys_url":"https://api.github.com/repos/ethereum/cpp-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/cpp-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/cpp-ethereum/teams","hooks_url":"https://api.github.com/repos/ethereum/cpp-ethereum/hooks","issue_events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/events","assignees_url":"https://api.github.com/repos/ethereum/cpp-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/cpp-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/cpp-ethereum/tags","blobs_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/cpp-ethereum/languages","stargazers_url":"https://api.github.com/repos/ethereum/cpp-ethereum/stargazers","contributors_url":"https://api.github.com/repos/ethereum/cpp-ethereum/contributors","subscribers_url":"https://api.github.com/repos/ethereum/cpp-ethereum/subscribers","subscription_url":"https://api.github.com/repos/ethereum/cpp-ethereum/subscription","commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/cpp-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/cpp-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/cpp-ethereum/merges","archive_url":"https://api.github.com/repos/ethereum/cpp-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/cpp-ethereum/downloads","issues_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/cpp-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/cpp-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/cpp-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/cpp-ethereum/releases{/id}","created_at":"2013-12-26T21:26:06Z","updated_at":"2015-04-15T15:45:12Z","pushed_at":"2015-04-15T16:06:49Z","git_url":"git://github.com/ethereum/cpp-ethereum.git","ssh_url":"git@github.com:ethereum/cpp-ethereum.git","clone_url":"https://github.com/ethereum/cpp-ethereum.git","svn_url":"https://github.com/ethereum/cpp-ethereum","homepage":"www.gavwood.com/Paper.pdf","size":93415,"stargazers_count":450,"watchers_count":450,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":154,"mirror_url":null,"open_issues_count":161,"forks":154,"open_issues":161,"watchers":450,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1604"},"html":{"href":"https://github.com/ethereum/cpp-ethereum/pull/1604"},"issue":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/1604"},"comments":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/1604/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1604/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1604/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/b11e640665dfe130fc442c955d3d58c114ff45ec"}}}}