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

Unified Diff: tools/findit/crash_utils.py

Issue 504443004: [Findit] Improve output format and cherry-pick bugs fix. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit. Created 6 years, 4 months 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/findit/crash_utils.py
diff --git a/tools/findit/crash_utils.py b/tools/findit/crash_utils.py
index 65ff72994674a80468b3c7488d2e9e4962f784bf..36f1f0095ecd330ab255b80033585f5b147028cf 100644
--- a/tools/findit/crash_utils.py
+++ b/tools/findit/crash_utils.py
@@ -108,7 +108,7 @@ def NormalizePath(path, parsed_deps):
repository is not supported, i.e from googlecode.
"""
# First normalize the path by retreiving the normalized path.
- normalized_path = os.path.normpath(path.replace('\\', '/'))
+ normalized_path = os.path.normpath(path).replace('\\', '/')
# Iterate through all component paths in the parsed DEPS, in the decreasing
# order of the length of the file path.
@@ -349,16 +349,24 @@ def AddHyperlink(text, link):
return '<a href="%s">%s</a>' % (sanitized_link, sanitized_text)
-def PrettifyList(l):
+def PrettifyList(items):
"""Returns a string representation of a list.
It adds comma in between the elements and removes the brackets.
Args:
- l: A list to prettify.
+ items: A list to prettify.
Returns:
A string representation of the list.
"""
- return str(l)[1:-1]
+ return ', '.join(map(str, items))
+
+
+def PrettifyFrameInfo(frame_indices, functions):
+ """Return a string to represent the frames with functions."""
+ frames = []
+ for frame_index, function in zip(frame_indices, functions):
+ frames.append('frame #%s, function "%s"' % (frame_index, function))
+ return '; '.join(frames)
def PrettifyFiles(file_list):

Powered by Google App Engine
This is Rietveld 408576698