{"action":"created","comment":{"url":"https://api.github.com/repos/eliben/pyelftools/pulls/comments/70168237","id":70168237,"diff_hunk":"@@ -0,0 +1,88 @@\n+#-------------------------------------------------------------------------------\n+# elftools: dwarf/aranges.py\n+#\n+# DWARF aranges section decoding (.debug_aranges)\n+#\n+# Dorothy Chen (dorothchen@gmail.com)\n+# This code is in the public domain\n+#-------------------------------------------------------------------------------\n+import os\n+from collections import namedtuple\n+from ..common.utils import struct_parse\n+from bisect import bisect_left\n+import math\n+\n+ARangeEntry = namedtuple('ARangeEntry', 'begin_addr length info_offset')\n+\n+class ARanges(object):\n+    \"\"\" ARanges table in DWARF\n+    \"\"\"\n+    def __init__(self, stream, size, structs):\n+        self.stream = stream\n+        self.size = size\n+        self.structs = structs\n+\n+        # entries is a sorted list of ARangeEntry tuples, \n+        # sorted by beginning address\n+        self.entries = self._get_entries()\n+        self.entries.sort(key=lambda entry: entry[0])\n+        self.keys = [entry[0] for entry in self.entries]\n+","path":"elftools/dwarf/aranges.py","position":30,"original_position":30,"commit_id":"3a3bf54f4b5b4c386eca4c7d380796db372b69d1","original_commit_id":"3a3bf54f4b5b4c386eca4c7d380796db372b69d1","user":{"login":"eliben","id":1130906,"avatar_url":"https://avatars.githubusercontent.com/u/1130906?v=3","gravatar_id":"","url":"https://api.github.com/users/eliben","html_url":"https://github.com/eliben","followers_url":"https://api.github.com/users/eliben/followers","following_url":"https://api.github.com/users/eliben/following{/other_user}","gists_url":"https://api.github.com/users/eliben/gists{/gist_id}","starred_url":"https://api.github.com/users/eliben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliben/subscriptions","organizations_url":"https://api.github.com/users/eliben/orgs","repos_url":"https://api.github.com/users/eliben/repos","events_url":"https://api.github.com/users/eliben/events{/privacy}","received_events_url":"https://api.github.com/users/eliben/received_events","type":"User","site_admin":false},"body":"here and elsewhere: please one blank line between class methods","created_at":"2016-07-09T15:09:49Z","updated_at":"2016-07-09T15:09:49Z","html_url":"https://github.com/eliben/pyelftools/pull/108#discussion_r70168237","pull_request_url":"https://api.github.com/repos/eliben/pyelftools/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/eliben/pyelftools/pulls/comments/70168237"},"html":{"href":"https://github.com/eliben/pyelftools/pull/108#discussion_r70168237"},"pull_request":{"href":"https://api.github.com/repos/eliben/pyelftools/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/eliben/pyelftools/pulls/108","id":76759731,"html_url":"https://github.com/eliben/pyelftools/pull/108","diff_url":"https://github.com/eliben/pyelftools/pull/108.diff","patch_url":"https://github.com/eliben/pyelftools/pull/108.patch","issue_url":"https://api.github.com/repos/eliben/pyelftools/issues/108","number":108,"state":"open","locked":false,"title":"parse .debug_aranges section","user":{"login":"dorothychen","id":5766511,"avatar_url":"https://avatars.githubusercontent.com/u/5766511?v=3","gravatar_id":"","url":"https://api.github.com/users/dorothychen","html_url":"https://github.com/dorothychen","followers_url":"https://api.github.com/users/dorothychen/followers","following_url":"https://api.github.com/users/dorothychen/following{/other_user}","gists_url":"https://api.github.com/users/dorothychen/gists{/gist_id}","starred_url":"https://api.github.com/users/dorothychen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorothychen/subscriptions","organizations_url":"https://api.github.com/users/dorothychen/orgs","repos_url":"https://api.github.com/users/dorothychen/repos","events_url":"https://api.github.com/users/dorothychen/events{/privacy}","received_events_url":"https://api.github.com/users/dorothychen/received_events","type":"User","site_admin":false},"body":"parse aranges table in dwarf and provide simple interface to get a CU offset from an address","created_at":"2016-07-08T14:17:53Z","updated_at":"2016-07-09T15:09:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aeaf8996c8c0d7cbfc7d307e2a096d844929beae","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eliben/pyelftools/pulls/108/commits","review_comments_url":"https://api.github.com/repos/eliben/pyelftools/pulls/108/comments","review_comment_url":"https://api.github.com/repos/eliben/pyelftools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eliben/pyelftools/issues/108/comments","statuses_url":"https://api.github.com/repos/eliben/pyelftools/statuses/3a3bf54f4b5b4c386eca4c7d380796db372b69d1","head":{"label":"dorothychen:aranges","ref":"aranges","sha":"3a3bf54f4b5b4c386eca4c7d380796db372b69d1","user":{"login":"dorothychen","id":5766511,"avatar_url":"https://avatars.githubusercontent.com/u/5766511?v=3","gravatar_id":"","url":"https://api.github.com/users/dorothychen","html_url":"https://github.com/dorothychen","followers_url":"https://api.github.com/users/dorothychen/followers","following_url":"https://api.github.com/users/dorothychen/following{/other_user}","gists_url":"https://api.github.com/users/dorothychen/gists{/gist_id}","starred_url":"https://api.github.com/users/dorothychen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorothychen/subscriptions","organizations_url":"https://api.github.com/users/dorothychen/orgs","repos_url":"https://api.github.com/users/dorothychen/repos","events_url":"https://api.github.com/users/dorothychen/events{/privacy}","received_events_url":"https://api.github.com/users/dorothychen/received_events","type":"User","site_admin":false},"repo":{"id":62087089,"name":"pyelftools","full_name":"dorothychen/pyelftools","owner":{"login":"dorothychen","id":5766511,"avatar_url":"https://avatars.githubusercontent.com/u/5766511?v=3","gravatar_id":"","url":"https://api.github.com/users/dorothychen","html_url":"https://github.com/dorothychen","followers_url":"https://api.github.com/users/dorothychen/followers","following_url":"https://api.github.com/users/dorothychen/following{/other_user}","gists_url":"https://api.github.com/users/dorothychen/gists{/gist_id}","starred_url":"https://api.github.com/users/dorothychen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorothychen/subscriptions","organizations_url":"https://api.github.com/users/dorothychen/orgs","repos_url":"https://api.github.com/users/dorothychen/repos","events_url":"https://api.github.com/users/dorothychen/events{/privacy}","received_events_url":"https://api.github.com/users/dorothychen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dorothychen/pyelftools","description":"Pure-python library for parsing ELF and DWARF","fork":true,"url":"https://api.github.com/repos/dorothychen/pyelftools","forks_url":"https://api.github.com/repos/dorothychen/pyelftools/forks","keys_url":"https://api.github.com/repos/dorothychen/pyelftools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dorothychen/pyelftools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dorothychen/pyelftools/teams","hooks_url":"https://api.github.com/repos/dorothychen/pyelftools/hooks","issue_events_url":"https://api.github.com/repos/dorothychen/pyelftools/issues/events{/number}","events_url":"https://api.github.com/repos/dorothychen/pyelftools/events","assignees_url":"https://api.github.com/repos/dorothychen/pyelftools/assignees{/user}","branches_url":"https://api.github.com/repos/dorothychen/pyelftools/branches{/branch}","tags_url":"https://api.github.com/repos/dorothychen/pyelftools/tags","blobs_url":"https://api.github.com/repos/dorothychen/pyelftools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dorothychen/pyelftools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dorothychen/pyelftools/git/refs{/sha}","trees_url":"https://api.github.com/repos/dorothychen/pyelftools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dorothychen/pyelftools/statuses/{sha}","languages_url":"https://api.github.com/repos/dorothychen/pyelftools/languages","stargazers_url":"https://api.github.com/repos/dorothychen/pyelftools/stargazers","contributors_url":"https://api.github.com/repos/dorothychen/pyelftools/contributors","subscribers_url":"https://api.github.com/repos/dorothychen/pyelftools/subscribers","subscription_url":"https://api.github.com/repos/dorothychen/pyelftools/subscription","commits_url":"https://api.github.com/repos/dorothychen/pyelftools/commits{/sha}","git_commits_url":"https://api.github.com/repos/dorothychen/pyelftools/git/commits{/sha}","comments_url":"https://api.github.com/repos/dorothychen/pyelftools/comments{/number}","issue_comment_url":"https://api.github.com/repos/dorothychen/pyelftools/issues/comments{/number}","contents_url":"https://api.github.com/repos/dorothychen/pyelftools/contents/{+path}","compare_url":"https://api.github.com/repos/dorothychen/pyelftools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dorothychen/pyelftools/merges","archive_url":"https://api.github.com/repos/dorothychen/pyelftools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dorothychen/pyelftools/downloads","issues_url":"https://api.github.com/repos/dorothychen/pyelftools/issues{/number}","pulls_url":"https://api.github.com/repos/dorothychen/pyelftools/pulls{/number}","milestones_url":"https://api.github.com/repos/dorothychen/pyelftools/milestones{/number}","notifications_url":"https://api.github.com/repos/dorothychen/pyelftools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dorothychen/pyelftools/labels{/name}","releases_url":"https://api.github.com/repos/dorothychen/pyelftools/releases{/id}","deployments_url":"https://api.github.com/repos/dorothychen/pyelftools/deployments","created_at":"2016-06-27T20:46:52Z","updated_at":"2016-06-27T20:46:53Z","pushed_at":"2016-07-08T22:13:38Z","git_url":"git://github.com/dorothychen/pyelftools.git","ssh_url":"git@github.com:dorothychen/pyelftools.git","clone_url":"https://github.com/dorothychen/pyelftools.git","svn_url":"https://github.com/dorothychen/pyelftools","homepage":null,"size":1243,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"master"}},"base":{"label":"eliben:master","ref":"master","sha":"bef4a4a08a238e821f9cd476bdb7c26b07e08b79","user":{"login":"eliben","id":1130906,"avatar_url":"https://avatars.githubusercontent.com/u/1130906?v=3","gravatar_id":"","url":"https://api.github.com/users/eliben","html_url":"https://github.com/eliben","followers_url":"https://api.github.com/users/eliben/followers","following_url":"https://api.github.com/users/eliben/following{/other_user}","gists_url":"https://api.github.com/users/eliben/gists{/gist_id}","starred_url":"https://api.github.com/users/eliben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliben/subscriptions","organizations_url":"https://api.github.com/users/eliben/orgs","repos_url":"https://api.github.com/users/eliben/repos","events_url":"https://api.github.com/users/eliben/events{/privacy}","received_events_url":"https://api.github.com/users/eliben/received_events","type":"User","site_admin":false},"repo":{"id":10575335,"name":"pyelftools","full_name":"eliben/pyelftools","owner":{"login":"eliben","id":1130906,"avatar_url":"https://avatars.githubusercontent.com/u/1130906?v=3","gravatar_id":"","url":"https://api.github.com/users/eliben","html_url":"https://github.com/eliben","followers_url":"https://api.github.com/users/eliben/followers","following_url":"https://api.github.com/users/eliben/following{/other_user}","gists_url":"https://api.github.com/users/eliben/gists{/gist_id}","starred_url":"https://api.github.com/users/eliben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliben/subscriptions","organizations_url":"https://api.github.com/users/eliben/orgs","repos_url":"https://api.github.com/users/eliben/repos","events_url":"https://api.github.com/users/eliben/events{/privacy}","received_events_url":"https://api.github.com/users/eliben/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eliben/pyelftools","description":"Pure-python library for parsing ELF and DWARF","fork":false,"url":"https://api.github.com/repos/eliben/pyelftools","forks_url":"https://api.github.com/repos/eliben/pyelftools/forks","keys_url":"https://api.github.com/repos/eliben/pyelftools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eliben/pyelftools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eliben/pyelftools/teams","hooks_url":"https://api.github.com/repos/eliben/pyelftools/hooks","issue_events_url":"https://api.github.com/repos/eliben/pyelftools/issues/events{/number}","events_url":"https://api.github.com/repos/eliben/pyelftools/events","assignees_url":"https://api.github.com/repos/eliben/pyelftools/assignees{/user}","branches_url":"https://api.github.com/repos/eliben/pyelftools/branches{/branch}","tags_url":"https://api.github.com/repos/eliben/pyelftools/tags","blobs_url":"https://api.github.com/repos/eliben/pyelftools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eliben/pyelftools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eliben/pyelftools/git/refs{/sha}","trees_url":"https://api.github.com/repos/eliben/pyelftools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eliben/pyelftools/statuses/{sha}","languages_url":"https://api.github.com/repos/eliben/pyelftools/languages","stargazers_url":"https://api.github.com/repos/eliben/pyelftools/stargazers","contributors_url":"https://api.github.com/repos/eliben/pyelftools/contributors","subscribers_url":"https://api.github.com/repos/eliben/pyelftools/subscribers","subscription_url":"https://api.github.com/repos/eliben/pyelftools/subscription","commits_url":"https://api.github.com/repos/eliben/pyelftools/commits{/sha}","git_commits_url":"https://api.github.com/repos/eliben/pyelftools/git/commits{/sha}","comments_url":"https://api.github.com/repos/eliben/pyelftools/comments{/number}","issue_comment_url":"https://api.github.com/repos/eliben/pyelftools/issues/comments{/number}","contents_url":"https://api.github.com/repos/eliben/pyelftools/contents/{+path}","compare_url":"https://api.github.com/repos/eliben/pyelftools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eliben/pyelftools/merges","archive_url":"https://api.github.com/repos/eliben/pyelftools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eliben/pyelftools/downloads","issues_url":"https://api.github.com/repos/eliben/pyelftools/issues{/number}","pulls_url":"https://api.github.com/repos/eliben/pyelftools/pulls{/number}","milestones_url":"https://api.github.com/repos/eliben/pyelftools/milestones{/number}","notifications_url":"https://api.github.com/repos/eliben/pyelftools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eliben/pyelftools/labels{/name}","releases_url":"https://api.github.com/repos/eliben/pyelftools/releases{/id}","deployments_url":"https://api.github.com/repos/eliben/pyelftools/deployments","created_at":"2013-06-08T22:55:54Z","updated_at":"2016-07-04T01:37:08Z","pushed_at":"2016-07-08T22:13:38Z","git_url":"git://github.com/eliben/pyelftools.git","ssh_url":"git@github.com:eliben/pyelftools.git","clone_url":"https://github.com/eliben/pyelftools.git","svn_url":"https://github.com/eliben/pyelftools","homepage":null,"size":1443,"stargazers_count":330,"watchers_count":330,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":120,"mirror_url":null,"open_issues_count":39,"forks":120,"open_issues":39,"watchers":330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eliben/pyelftools/pulls/108"},"html":{"href":"https://github.com/eliben/pyelftools/pull/108"},"issue":{"href":"https://api.github.com/repos/eliben/pyelftools/issues/108"},"comments":{"href":"https://api.github.com/repos/eliben/pyelftools/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/eliben/pyelftools/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/eliben/pyelftools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eliben/pyelftools/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/eliben/pyelftools/statuses/3a3bf54f4b5b4c386eca4c7d380796db372b69d1"}}}}
{"actor":{"display_login":"eliben"}}