Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: tools/find_runtime_symbols/proc_maps.py

Issue 50663002: Fix tools/find_runtime_symbols/prepare_symbol_info.py to accept non-Chrome binaries. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 6
7 7
8 _MAPS_PATTERN = re.compile( 8 _MAPS_PATTERN = re.compile(
9 r'^([a-f0-9]+)-([a-f0-9]+)\s+(.)(.)(.)(.)\s+([a-f0-9]+)\s+(\S+):(\S+)\s+' 9 r'^([a-f0-9]+)-([a-f0-9]+)\s+(.)(.)(.)(.)\s+([a-f0-9]+)\s+(\S+):(\S+)\s+'
10 r'(\d+)\s*(.*)$', re.IGNORECASE) 10 r'(\d+)\s*(.*)$', re.IGNORECASE)
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 matched.group(8), # major 94 matched.group(8), # major
95 matched.group(9), # minor 95 matched.group(9), # minor
96 int(matched.group(10), 10), # inode 96 int(matched.group(10), 10), # inode
97 matched.group(11) # name 97 matched.group(11) # name
98 ) 98 )
99 else: 99 else:
100 return None 100 return None
101 101
102 @staticmethod 102 @staticmethod
103 def constants(entry): 103 def constants(entry):
104 return (entry.writable == '-' and entry.executable == '-' and re.match( 104 return (entry.writable == '-' and entry.executable == '-' and
105 '\S+(\.(so|dll|dylib|bundle)|chrome)((\.\d+)+\w*(\.\d+){0,3})?', 105 entry.name.startswith('/'))
106 entry.name))
107 106
108 @staticmethod 107 @staticmethod
109 def executable(entry): 108 def executable(entry):
110 return (entry.executable == 'x' and re.match( 109 return (entry.executable == 'x' and entry.name.startswith('/'))
111 '\S+(\.(so|dll|dylib|bundle)|chrome)((\.\d+)+\w*(\.\d+){0,3})?',
112 entry.name))
113 110
114 @staticmethod 111 @staticmethod
115 def executable_and_constants(entry): 112 def executable_and_constants(entry):
116 return (((entry.writable == '-' and entry.executable == '-') or 113 return (((entry.writable == '-' and entry.executable == '-') or
117 entry.executable == 'x') and re.match( 114 entry.executable == 'x') and entry.name.startswith('/'))
118 '\S+(\.(so|dll|dylib|bundle)|chrome)((\.\d+)+\w*(\.\d+){0,3})?',
119 entry.name))
120 115
121 def _append_entry(self, entry): 116 def _append_entry(self, entry):
122 if self._sorted_indexes and self._sorted_indexes[-1] > entry.begin: 117 if self._sorted_indexes and self._sorted_indexes[-1] > entry.begin:
123 self._sorted = False 118 self._sorted = False
124 self._sorted_indexes.append(entry.begin) 119 self._sorted_indexes.append(entry.begin)
125 self._dictionary[entry.begin] = entry 120 self._dictionary[entry.begin] = entry
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698