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

Side by Side Diff: tools/findit/stacktrace.py

Issue 510163002: [Findit] Fix blame for GIT and uptake bug fix. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reupload Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « tools/findit/findit_for_crash.py ('k') | 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) 2014 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2014 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 import crash_utils 7 import crash_utils
8 8
9 9
10 SYZYASAN_STACK_FRAME_PATTERN = re.compile( 10 SYZYASAN_STACK_FRAME_PATTERN = re.compile(
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 return None 287 return None
288 except ValueError: 288 except ValueError:
289 return None 289 return None
290 290
291 # Normalize the file path so that it can be compared to repository path. 291 # Normalize the file path so that it can be compared to repository path.
292 (component_path, component_name, file_path) = ( 292 (component_path, component_name, file_path) = (
293 crash_utils.NormalizePath(file_path, parsed_deps)) 293 crash_utils.NormalizePath(file_path, parsed_deps))
294 294
295 # Return a new stack frame object with the parsed information. 295 # Return a new stack frame object with the parsed information.
296 file_name = file_path.split('/')[-1] 296 file_name = file_path.split('/')[-1]
297
298 # If we have the common stack frame index pattern, then use it
299 # since it is more reliable.
300 index_match = re.match('\s*#(\d+)\s.*', line)
301 if index_match:
302 stack_frame_index = int(index_match.group(1))
303
297 return StackFrame(stack_frame_index, component_path, component_name, 304 return StackFrame(stack_frame_index, component_path, component_name,
298 file_name, function, file_path, crashed_line_range) 305 file_name, function, file_path, crashed_line_range)
299 306
300 def __getitem__(self, index): 307 def __getitem__(self, index):
301 return self.stack_list[index] 308 return self.stack_list[index]
302 309
303 def GetCrashStack(self): 310 def GetCrashStack(self):
304 """Returns the callstack with the highest priority. 311 """Returns the callstack with the highest priority.
305 312
306 Crash stack has priority 0, and allocation/freed/other thread stacks 313 Crash stack has priority 0, and allocation/freed/other thread stacks
307 get priority 1. 314 get priority 1.
308 315
309 Returns: 316 Returns:
310 The highest priority callstack in the stacktrace. 317 The highest priority callstack in the stacktrace.
311 """ 318 """
312 sorted_stacklist = sorted(self.stack_list, 319 sorted_stacklist = sorted(self.stack_list,
313 key=lambda callstack: callstack.priority) 320 key=lambda callstack: callstack.priority)
314 return sorted_stacklist[0] 321 return sorted_stacklist[0]
OLDNEW
« no previous file with comments | « tools/findit/findit_for_crash.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698