Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 datetime | 5 import datetime |
| 6 import glob | 6 import glob |
| 7 import heapq | 7 import heapq |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import os.path | 10 import os.path |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 return output[info_start:info_end] | 486 return output[info_start:info_end] |
| 487 | 487 |
| 488 arch_name = self.browser.platform.GetArchName() | 488 arch_name = self.browser.platform.GetArchName() |
| 489 stackwalk = binary_manager.FetchPath( | 489 stackwalk = binary_manager.FetchPath( |
| 490 'minidump_stackwalk', arch_name, os_name) | 490 'minidump_stackwalk', arch_name, os_name) |
| 491 if not stackwalk: | 491 if not stackwalk: |
| 492 logging.warning('minidump_stackwalk binary not found.') | 492 logging.warning('minidump_stackwalk binary not found.') |
| 493 return None | 493 return None |
| 494 | 494 |
| 495 with open(minidump, 'rb') as infile: | 495 with open(minidump, 'rb') as infile: |
| 496 minidump += '.stripped' | 496 if os_name != 'mac': |
| 497 minidump += '.stripped' | |
| 497 with open(minidump, 'wb') as outfile: | 498 with open(minidump, 'wb') as outfile: |
| 498 outfile.write(''.join(infile.read().partition('MDMP')[1:])) | 499 outfile.write(''.join(infile.read().partition('MDMP')[1:])) |
|
Ken Russell (switch to Gerrit)
2016/12/01 22:43:04
Per mark's comment in https://bugs.chromium.org/p/
eyaich1
2016/12/01 23:13:00
Done.
| |
| 499 | 500 |
| 500 symbols_path = os.path.join(self._tmp_minidump_dir, 'symbols') | 501 symbols_path = os.path.join(self._tmp_minidump_dir, 'symbols') |
| 501 GenerateBreakpadSymbols(minidump, arch_name, os_name, | 502 GenerateBreakpadSymbols(minidump, arch_name, os_name, |
| 502 symbols_path, self._browser_directory) | 503 symbols_path, self._browser_directory) |
| 503 | 504 |
| 504 return subprocess.check_output([stackwalk, minidump, symbols_path], | 505 return subprocess.check_output([stackwalk, minidump, symbols_path], |
| 505 stderr=open(os.devnull, 'w')) | 506 stderr=open(os.devnull, 'w')) |
| 506 | 507 |
| 507 def _UploadMinidumpToCloudStorage(self, minidump_path): | 508 def _UploadMinidumpToCloudStorage(self, minidump_path): |
| 508 """ Upload minidump_path to cloud storage and return the cloud storage url. | 509 """ Upload minidump_path to cloud storage and return the cloud storage url. |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 529 return (False, 'No crash dump found.') | 530 return (False, 'No crash dump found.') |
| 530 logging.info('Minidump found: %s' % most_recent_dump) | 531 logging.info('Minidump found: %s' % most_recent_dump) |
| 531 return self._InternalSymbolizeMinidump(most_recent_dump) | 532 return self._InternalSymbolizeMinidump(most_recent_dump) |
| 532 | 533 |
| 533 def GetMostRecentMinidumpPath(self): | 534 def GetMostRecentMinidumpPath(self): |
| 534 return self._GetMostRecentMinidump() | 535 return self._GetMostRecentMinidump() |
| 535 | 536 |
| 536 def GetAllMinidumpPaths(self): | 537 def GetAllMinidumpPaths(self): |
| 537 reports_list = self._GetAllCrashpadMinidumps() | 538 reports_list = self._GetAllCrashpadMinidumps() |
| 538 if reports_list: | 539 if reports_list: |
| 539 return [report[1] for report in reports_list] | 540 return [report[1] for report in reports_list] |
|
Mark Mentovai
2016/12/01 22:46:56
Here is where you know you’ve gotten minidumps fro
eyaich1
2016/12/01 23:13:00
Acknowledged.
| |
| 540 else: | 541 else: |
| 541 logging.info('No minidump found via crashpad_database_util') | 542 logging.info('No minidump found via crashpad_database_util') |
| 542 dumps = self._GetBreakPadMinidumpPaths() | 543 dumps = self._GetBreakPadMinidumpPaths() |
| 543 if dumps: | 544 if dumps: |
| 544 logging.info('Found minidump via globbing in minidump dir') | 545 logging.info('Found minidump via globbing in minidump dir') |
| 545 return dumps | 546 return dumps |
| 546 return [] | 547 return [] |
| 547 | 548 |
| 548 def GetAllUnsymbolizedMinidumpPaths(self): | 549 def GetAllUnsymbolizedMinidumpPaths(self): |
| 549 minidump_paths = set(self.GetAllMinidumpPaths()) | 550 minidump_paths = set(self.GetAllMinidumpPaths()) |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 622 shutil.rmtree(self._tmp_profile_dir, ignore_errors=True) | 623 shutil.rmtree(self._tmp_profile_dir, ignore_errors=True) |
| 623 self._tmp_profile_dir = None | 624 self._tmp_profile_dir = None |
| 624 | 625 |
| 625 if self._tmp_output_file: | 626 if self._tmp_output_file: |
| 626 self._tmp_output_file.close() | 627 self._tmp_output_file.close() |
| 627 self._tmp_output_file = None | 628 self._tmp_output_file = None |
| 628 | 629 |
| 629 if self._tmp_minidump_dir: | 630 if self._tmp_minidump_dir: |
| 630 shutil.rmtree(self._tmp_minidump_dir, ignore_errors=True) | 631 shutil.rmtree(self._tmp_minidump_dir, ignore_errors=True) |
| 631 self._tmp_minidump_dir = None | 632 self._tmp_minidump_dir = None |
| OLD | NEW |