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

Unified Diff: tools/find_runtime_symbols/proc_maps.py

Issue 11299095: Add a first test for tools/find_runtime_symbols. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698