{"action":"created","comment":{"url":"https://api.github.com/repos/mgyenik/go/pulls/comments/47387577","id":47387577,"diff_hunk":"@@ -0,0 +1,115 @@\n+// Copyright 2015 The Go Authors. All rights reserved.\n+// Use of this source code is governed by a BSD-style\n+// license that can be found in the LICENSE file.\n+\n+package main\n+\n+import (\n+\t\"flag\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"log\"\n+\t\"os\"\n+\t\"os/exec\"\n+\t\"strings\"\n+\n+\t\"cmd/internal/goobj\"\n+\t\"cmd/internal/obj\"\n+)\n+\n+func objdumpcmd(fname string) *exec.Cmd {\n+\tGOARCH := obj.Getgoarch()\n+\tswitch GOARCH {\n+\tcase \"arm\":\n+\t\treturn exec.Command(\n+\t\t\t\"arm-none-eabi-objdump\",\n+\t\t\t\"-b\", \"binary\",\n+\t\t\t\"-m\", \"arm\",\n+\t\t\t\"-EL\",\n+\t\t\t\"-D\", fname)\n+\tcase \"riscv\":\n+\t\treturn exec.Command(\n+\t\t\t\"riscv64-unknown-elf-objdump\",\n+\t\t\t\"-b\", \"binary\",\n+\t\t\t\"-m\", \"riscv:rv64\",\n+\t\t\t\"-EL\",\n+\t\t\t\"-D\", fname)\n+\tdefault:\n+\t\tlog.Fatalf(\"unsupported architecture %s\", GOARCH)\n+\t}\n+\treturn nil\n+}\n+\n+func disas1(sym *goobj.Sym, data []byte) {","path":"src/cmd/disas/main.go","position":43,"original_position":43,"commit_id":"78112f97aeda387cb1aeacc772792f6a6581750e","original_commit_id":"78112f97aeda387cb1aeacc772792f6a6581750e","user":{"login":"mgyenik","id":644163,"avatar_url":"https://avatars.githubusercontent.com/u/644163?v=3","gravatar_id":"","url":"https://api.github.com/users/mgyenik","html_url":"https://github.com/mgyenik","followers_url":"https://api.github.com/users/mgyenik/followers","following_url":"https://api.github.com/users/mgyenik/following{/other_user}","gists_url":"https://api.github.com/users/mgyenik/gists{/gist_id}","starred_url":"https://api.github.com/users/mgyenik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgyenik/subscriptions","organizations_url":"https://api.github.com/users/mgyenik/orgs","repos_url":"https://api.github.com/users/mgyenik/repos","events_url":"https://api.github.com/users/mgyenik/events{/privacy}","received_events_url":"https://api.github.com/users/mgyenik/received_events","type":"User","site_admin":false},"body":"If these wrote to an io.Writer and had the temp file creation one level higher, it would be easy to have this support disassembling to files, stdout/stderr, etc...","created_at":"2015-12-11T18:33:03Z","updated_at":"2015-12-11T18:33:03Z","html_url":"https://github.com/mgyenik/go/pull/4#discussion_r47387577","pull_request_url":"https://api.github.com/repos/mgyenik/go/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/mgyenik/go/pulls/comments/47387577"},"html":{"href":"https://github.com/mgyenik/go/pull/4#discussion_r47387577"},"pull_request":{"href":"https://api.github.com/repos/mgyenik/go/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/mgyenik/go/pulls/4","id":53297523,"html_url":"https://github.com/mgyenik/go/pull/4","diff_url":"https://github.com/mgyenik/go/pull/4.diff","patch_url":"https://github.com/mgyenik/go/pull/4.patch","issue_url":"https://api.github.com/repos/mgyenik/go/issues/4","number":4,"state":"open","locked":false,"title":"Create basic Go disassembler","user":{"login":"bbarenblat","id":629239,"avatar_url":"https://avatars.githubusercontent.com/u/629239?v=3","gravatar_id":"","url":"https://api.github.com/users/bbarenblat","html_url":"https://github.com/bbarenblat","followers_url":"https://api.github.com/users/bbarenblat/followers","following_url":"https://api.github.com/users/bbarenblat/following{/other_user}","gists_url":"https://api.github.com/users/bbarenblat/gists{/gist_id}","starred_url":"https://api.github.com/users/bbarenblat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbarenblat/subscriptions","organizations_url":"https://api.github.com/users/bbarenblat/orgs","repos_url":"https://api.github.com/users/bbarenblat/repos","events_url":"https://api.github.com/users/bbarenblat/events{/privacy}","received_events_url":"https://api.github.com/users/bbarenblat/received_events","type":"User","site_admin":false},"body":"Create a tool, accessible through ‘go tool disas’, to disassemble Go object files.  The tool is extremely simple – it merely walks through all the sections in the Go object file and runs each section through objdump -D.\r\n\r\nCurrently, the objdump command lines are hard-coded, so the tool supports only arm and riscv.","created_at":"2015-12-10T18:29:33Z","updated_at":"2015-12-11T18:33:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fb41a60750b06f1313cf973f62b01406f5ed493","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mgyenik/go/pulls/4/commits","review_comments_url":"https://api.github.com/repos/mgyenik/go/pulls/4/comments","review_comment_url":"https://api.github.com/repos/mgyenik/go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mgyenik/go/issues/4/comments","statuses_url":"https://api.github.com/repos/mgyenik/go/statuses/78112f97aeda387cb1aeacc772792f6a6581750e","head":{"label":"bbarenblat:riscvdev","ref":"riscvdev","sha":"78112f97aeda387cb1aeacc772792f6a6581750e","user":{"login":"bbarenblat","id":629239,"avatar_url":"https://avatars.githubusercontent.com/u/629239?v=3","gravatar_id":"","url":"https://api.github.com/users/bbarenblat","html_url":"https://github.com/bbarenblat","followers_url":"https://api.github.com/users/bbarenblat/followers","following_url":"https://api.github.com/users/bbarenblat/following{/other_user}","gists_url":"https://api.github.com/users/bbarenblat/gists{/gist_id}","starred_url":"https://api.github.com/users/bbarenblat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbarenblat/subscriptions","organizations_url":"https://api.github.com/users/bbarenblat/orgs","repos_url":"https://api.github.com/users/bbarenblat/repos","events_url":"https://api.github.com/users/bbarenblat/events{/privacy}","received_events_url":"https://api.github.com/users/bbarenblat/received_events","type":"User","site_admin":false},"repo":{"id":47219760,"name":"go","full_name":"bbarenblat/go","owner":{"login":"bbarenblat","id":629239,"avatar_url":"https://avatars.githubusercontent.com/u/629239?v=3","gravatar_id":"","url":"https://api.github.com/users/bbarenblat","html_url":"https://github.com/bbarenblat","followers_url":"https://api.github.com/users/bbarenblat/followers","following_url":"https://api.github.com/users/bbarenblat/following{/other_user}","gists_url":"https://api.github.com/users/bbarenblat/gists{/gist_id}","starred_url":"https://api.github.com/users/bbarenblat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbarenblat/subscriptions","organizations_url":"https://api.github.com/users/bbarenblat/orgs","repos_url":"https://api.github.com/users/bbarenblat/repos","events_url":"https://api.github.com/users/bbarenblat/events{/privacy}","received_events_url":"https://api.github.com/users/bbarenblat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bbarenblat/go","description":"The Go programming language","fork":true,"url":"https://api.github.com/repos/bbarenblat/go","forks_url":"https://api.github.com/repos/bbarenblat/go/forks","keys_url":"https://api.github.com/repos/bbarenblat/go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbarenblat/go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbarenblat/go/teams","hooks_url":"https://api.github.com/repos/bbarenblat/go/hooks","issue_events_url":"https://api.github.com/repos/bbarenblat/go/issues/events{/number}","events_url":"https://api.github.com/repos/bbarenblat/go/events","assignees_url":"https://api.github.com/repos/bbarenblat/go/assignees{/user}","branches_url":"https://api.github.com/repos/bbarenblat/go/branches{/branch}","tags_url":"https://api.github.com/repos/bbarenblat/go/tags","blobs_url":"https://api.github.com/repos/bbarenblat/go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbarenblat/go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbarenblat/go/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbarenblat/go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbarenblat/go/statuses/{sha}","languages_url":"https://api.github.com/repos/bbarenblat/go/languages","stargazers_url":"https://api.github.com/repos/bbarenblat/go/stargazers","contributors_url":"https://api.github.com/repos/bbarenblat/go/contributors","subscribers_url":"https://api.github.com/repos/bbarenblat/go/subscribers","subscription_url":"https://api.github.com/repos/bbarenblat/go/subscription","commits_url":"https://api.github.com/repos/bbarenblat/go/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbarenblat/go/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbarenblat/go/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbarenblat/go/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbarenblat/go/contents/{+path}","compare_url":"https://api.github.com/repos/bbarenblat/go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbarenblat/go/merges","archive_url":"https://api.github.com/repos/bbarenblat/go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbarenblat/go/downloads","issues_url":"https://api.github.com/repos/bbarenblat/go/issues{/number}","pulls_url":"https://api.github.com/repos/bbarenblat/go/pulls{/number}","milestones_url":"https://api.github.com/repos/bbarenblat/go/milestones{/number}","notifications_url":"https://api.github.com/repos/bbarenblat/go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbarenblat/go/labels{/name}","releases_url":"https://api.github.com/repos/bbarenblat/go/releases{/id}","created_at":"2015-12-01T21:54:41Z","updated_at":"2015-12-01T21:55:02Z","pushed_at":"2015-12-10T18:26:29Z","git_url":"git://github.com/bbarenblat/go.git","ssh_url":"git@github.com:bbarenblat/go.git","clone_url":"https://github.com/bbarenblat/go.git","svn_url":"https://github.com/bbarenblat/go","homepage":"https://golang.org","size":78216,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"riscvdev"}},"base":{"label":"mgyenik:riscvdev","ref":"riscvdev","sha":"835daefaf14314b3972efe280ca70f0a07010785","user":{"login":"mgyenik","id":644163,"avatar_url":"https://avatars.githubusercontent.com/u/644163?v=3","gravatar_id":"","url":"https://api.github.com/users/mgyenik","html_url":"https://github.com/mgyenik","followers_url":"https://api.github.com/users/mgyenik/followers","following_url":"https://api.github.com/users/mgyenik/following{/other_user}","gists_url":"https://api.github.com/users/mgyenik/gists{/gist_id}","starred_url":"https://api.github.com/users/mgyenik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgyenik/subscriptions","organizations_url":"https://api.github.com/users/mgyenik/orgs","repos_url":"https://api.github.com/users/mgyenik/repos","events_url":"https://api.github.com/users/mgyenik/events{/privacy}","received_events_url":"https://api.github.com/users/mgyenik/received_events","type":"User","site_admin":false},"repo":{"id":42979727,"name":"go","full_name":"mgyenik/go","owner":{"login":"mgyenik","id":644163,"avatar_url":"https://avatars.githubusercontent.com/u/644163?v=3","gravatar_id":"","url":"https://api.github.com/users/mgyenik","html_url":"https://github.com/mgyenik","followers_url":"https://api.github.com/users/mgyenik/followers","following_url":"https://api.github.com/users/mgyenik/following{/other_user}","gists_url":"https://api.github.com/users/mgyenik/gists{/gist_id}","starred_url":"https://api.github.com/users/mgyenik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgyenik/subscriptions","organizations_url":"https://api.github.com/users/mgyenik/orgs","repos_url":"https://api.github.com/users/mgyenik/repos","events_url":"https://api.github.com/users/mgyenik/events{/privacy}","received_events_url":"https://api.github.com/users/mgyenik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mgyenik/go","description":"The Go programming language","fork":true,"url":"https://api.github.com/repos/mgyenik/go","forks_url":"https://api.github.com/repos/mgyenik/go/forks","keys_url":"https://api.github.com/repos/mgyenik/go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mgyenik/go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mgyenik/go/teams","hooks_url":"https://api.github.com/repos/mgyenik/go/hooks","issue_events_url":"https://api.github.com/repos/mgyenik/go/issues/events{/number}","events_url":"https://api.github.com/repos/mgyenik/go/events","assignees_url":"https://api.github.com/repos/mgyenik/go/assignees{/user}","branches_url":"https://api.github.com/repos/mgyenik/go/branches{/branch}","tags_url":"https://api.github.com/repos/mgyenik/go/tags","blobs_url":"https://api.github.com/repos/mgyenik/go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mgyenik/go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mgyenik/go/git/refs{/sha}","trees_url":"https://api.github.com/repos/mgyenik/go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mgyenik/go/statuses/{sha}","languages_url":"https://api.github.com/repos/mgyenik/go/languages","stargazers_url":"https://api.github.com/repos/mgyenik/go/stargazers","contributors_url":"https://api.github.com/repos/mgyenik/go/contributors","subscribers_url":"https://api.github.com/repos/mgyenik/go/subscribers","subscription_url":"https://api.github.com/repos/mgyenik/go/subscription","commits_url":"https://api.github.com/repos/mgyenik/go/commits{/sha}","git_commits_url":"https://api.github.com/repos/mgyenik/go/git/commits{/sha}","comments_url":"https://api.github.com/repos/mgyenik/go/comments{/number}","issue_comment_url":"https://api.github.com/repos/mgyenik/go/issues/comments{/number}","contents_url":"https://api.github.com/repos/mgyenik/go/contents/{+path}","compare_url":"https://api.github.com/repos/mgyenik/go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mgyenik/go/merges","archive_url":"https://api.github.com/repos/mgyenik/go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mgyenik/go/downloads","issues_url":"https://api.github.com/repos/mgyenik/go/issues{/number}","pulls_url":"https://api.github.com/repos/mgyenik/go/pulls{/number}","milestones_url":"https://api.github.com/repos/mgyenik/go/milestones{/number}","notifications_url":"https://api.github.com/repos/mgyenik/go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mgyenik/go/labels{/name}","releases_url":"https://api.github.com/repos/mgyenik/go/releases{/id}","created_at":"2015-09-23T05:13:15Z","updated_at":"2015-09-23T05:13:35Z","pushed_at":"2015-12-10T18:29:33Z","git_url":"git://github.com/mgyenik/go.git","ssh_url":"git@github.com:mgyenik/go.git","clone_url":"https://github.com/mgyenik/go.git","svn_url":"https://github.com/mgyenik/go","homepage":"https://golang.org","size":82157,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"riscvdev"}},"_links":{"self":{"href":"https://api.github.com/repos/mgyenik/go/pulls/4"},"html":{"href":"https://github.com/mgyenik/go/pull/4"},"issue":{"href":"https://api.github.com/repos/mgyenik/go/issues/4"},"comments":{"href":"https://api.github.com/repos/mgyenik/go/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/mgyenik/go/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/mgyenik/go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mgyenik/go/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/mgyenik/go/statuses/78112f97aeda387cb1aeacc772792f6a6581750e"}}}}