Chromium Code Reviews| Index: tools/find_runtime_symbols/proc_maps.py |
| diff --git a/tools/find_runtime_symbols/proc_maps.py b/tools/find_runtime_symbols/proc_maps.py |
| index 4b082c33b37283d4455d4df8daf64e719255f9a2..88382ec98d18bbd49d1168eb398411ddb239b115 100644 |
| --- a/tools/find_runtime_symbols/proc_maps.py |
| +++ b/tools/find_runtime_symbols/proc_maps.py |
| @@ -3,12 +3,11 @@ |
| # found in the LICENSE file. |
| import re |
| -import sys |
| _MAPS_PATTERN = re.compile( |
| '^([a-f0-9]+)-([a-f0-9]+)\s+(.)(.)(.)(.)\s+([a-f0-9]+)\s+(\S+):(\S+)\s+' |
| - '(\d+)\s+(\S+)$', re.IGNORECASE) |
| + '(\d+)\s*(.*)$', re.IGNORECASE) |
| class ProcMapsEntry(object): |
| @@ -38,12 +37,6 @@ class ProcMaps(object): |
| self._dictionary = {} |
| self._sorted = True |
| - def append(self, entry): |
| - if self._sorted_indexes and self._sorted_indexes[-1] > entry.begin: |
| - self._sorted = False |
| - self._sorted_indexes.append(entry.begin) |
| - self._dictionary[entry.begin] = entry |
| - |
| def iter(self, condition): |
| if not self._sorted: |
| self._sorted_indexes.sort() |
| @@ -65,7 +58,7 @@ class ProcMaps(object): |
| for line in f: |
| matched = _MAPS_PATTERN.match(line) |
| if matched: |
| - table.append(ProcMapsEntry( |
| + table._append(ProcMapsEntry( # pylint: disable=W0212 |
|
M-A Ruel
2012/11/20 14:30:00
2 spaces
Dai Mikurube (NOT FULLTIME)
2012/11/21 05:51:45
Done.
|
| int(matched.group(1), 16), # begin |
| int(matched.group(2), 16), # end |
| matched.group(3), # readable |
| @@ -99,3 +92,9 @@ class ProcMaps(object): |
| entry.executable == 'x') and re.match( |
| '\S+(\.(so|dll|dylib|bundle)|chrome)((\.\d+)+\w*(\.\d+){0,3})?', |
| entry.name)) |
| + |
| + def _append(self, entry): |
| + if self._sorted_indexes and self._sorted_indexes[-1] > entry.begin: |
| + self._sorted = False |
| + self._sorted_indexes.append(entry.begin) |
| + self._dictionary[entry.begin] = entry |