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