OLD | NEW |
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 sys |
| 6 |
5 import chromium_deps | 7 import chromium_deps |
6 from common import utils | 8 from common import utils |
7 import crash_utils | 9 import crash_utils |
8 import findit_for_crash as findit | 10 import findit_for_crash as findit |
9 import stacktrace | 11 import stacktrace |
10 | 12 |
11 | 13 |
12 def SplitStacktrace(stacktrace_string): | 14 def SplitStacktrace(stacktrace_string): |
13 """Preprocesses stacktrace string into two parts, release and debug. | 15 """Preprocesses stacktrace string into two parts, release and debug. |
14 | 16 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 chrome_regression = crash_utils.SplitRange(chrome_regression) | 103 chrome_regression = crash_utils.SplitRange(chrome_regression) |
102 if chrome_regression: | 104 if chrome_regression: |
103 chrome_regression_start = chrome_regression[0] | 105 chrome_regression_start = chrome_regression[0] |
104 chrome_regression_end = chrome_regression[1] | 106 chrome_regression_end = chrome_regression[1] |
105 | 107 |
106 # Do not parse regression information for crashes introduced before the | 108 # Do not parse regression information for crashes introduced before the |
107 # first archived build. | 109 # first archived build. |
108 if chrome_regression_start != '0': | 110 if chrome_regression_start != '0': |
109 component_to_regression_dict = chromium_deps.GetChromiumComponentRange( | 111 component_to_regression_dict = chromium_deps.GetChromiumComponentRange( |
110 chrome_regression_start, chrome_regression_end) | 112 chrome_regression_start, chrome_regression_end) |
| 113 if not component_to_regression_dict: |
| 114 print ('Failed to get component regression ranges for chromium ' |
| 115 'regression range %s:%s' |
| 116 % (chrome_regression_start, chrome_regression_end)) |
| 117 sys.exit(1) |
111 | 118 |
112 # Parse crash revision. | 119 # Parse crash revision. |
113 if chrome_crash_revision: | 120 if chrome_crash_revision: |
114 component_to_crash_revision_dict = chromium_deps.GetChromiumComponents( | 121 component_to_crash_revision_dict = chromium_deps.GetChromiumComponents( |
115 chrome_crash_revision) | 122 chrome_crash_revision) |
| 123 if not component_to_crash_revision_dict: |
| 124 print ('Failed to get component dependencies for chromium revision "%s".' |
| 125 % chrome_crash_revision) |
| 126 sys.exit(1) |
116 | 127 |
117 # Check if component regression information is available. | 128 # Check if component regression information is available. |
118 component_regression = crash_utils.SplitRange(component_regression) | 129 component_regression = crash_utils.SplitRange(component_regression) |
119 if component_regression: | 130 if component_regression: |
120 component_regression_start = component_regression[0] | 131 component_regression_start = component_regression[0] |
121 component_regression_end = component_regression[1] | 132 component_regression_end = component_regression[1] |
122 | 133 |
123 # If this component already has an entry in parsed DEPS file, overwrite | 134 # If this component already has an entry in parsed DEPS file, overwrite |
124 # regression range and url. | 135 # regression range and url. |
125 if crashing_component_path in component_to_regression_dict: | 136 if crashing_component_path in component_to_regression_dict: |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 # build stacktrace in higher priority than debug build stacktace. This stack | 211 # build stacktrace in higher priority than debug build stacktace. This stack |
201 # is the callstack to find blame information for. | 212 # is the callstack to find blame information for. |
202 if parsed_release_build_stacktrace.stack_list: | 213 if parsed_release_build_stacktrace.stack_list: |
203 main_stack = parsed_release_build_stacktrace.GetCrashStack() | 214 main_stack = parsed_release_build_stacktrace.GetCrashStack() |
204 elif parsed_debug_build_stacktrace.stack_list: | 215 elif parsed_debug_build_stacktrace.stack_list: |
205 main_stack = parsed_debug_build_stacktrace.GetCrashStack() | 216 main_stack = parsed_debug_build_stacktrace.GetCrashStack() |
206 else: | 217 else: |
207 if 'mac_' in build_type: | 218 if 'mac_' in build_type: |
208 return ('No line information available in stacktrace.', []) | 219 return ('No line information available in stacktrace.', []) |
209 | 220 |
210 return ('Stacktrace is malformed.', []) | 221 return ('Findit failed to find any stack trace. Is it in a new format?', []) |
211 | 222 |
212 # Run the algorithm on the parsed stacktrace, and return the result. | 223 # Run the algorithm on the parsed stacktrace, and return the result. |
213 stacktrace_list = [parsed_release_build_stacktrace, | 224 stacktrace_list = [parsed_release_build_stacktrace, |
214 parsed_debug_build_stacktrace] | 225 parsed_debug_build_stacktrace] |
215 return findit.FindItForCrash( | 226 return findit.FindItForCrash( |
216 stacktrace_list, main_stack, component_to_regression_dict, | 227 stacktrace_list, main_stack, component_to_regression_dict, |
217 component_to_crash_revision_dict) | 228 component_to_crash_revision_dict) |
OLD | NEW |