| OLD | NEW |
| 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
| 3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 # This file contains a set of utilities functions used by other Python-based | 5 # This file contains a set of utilities functions used by other Python-based |
| 6 # scripts. | 6 # scripts. |
| 7 | 7 |
| 8 import commands | 8 import commands |
| 9 import contextlib | 9 import contextlib |
| 10 import datetime | 10 import datetime |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 def __init__(self): | 719 def __init__(self): |
| 720 self._old_limits = None | 720 self._old_limits = None |
| 721 | 721 |
| 722 def __enter__(self): | 722 def __enter__(self): |
| 723 self._old_limits = resource.getrlimit(resource.RLIMIT_CORE) | 723 self._old_limits = resource.getrlimit(resource.RLIMIT_CORE) |
| 724 resource.setrlimit(resource.RLIMIT_CORE, (-1, -1)) | 724 resource.setrlimit(resource.RLIMIT_CORE, (-1, -1)) |
| 725 | 725 |
| 726 def __exit__(self, *_): | 726 def __exit__(self, *_): |
| 727 resource.setrlimit(resource.RLIMIT_CORE, self._old_limits) | 727 resource.setrlimit(resource.RLIMIT_CORE, self._old_limits) |
| 728 | 728 |
| 729 # TODO(whesse): Re-enable after issue #30205 is addressed |
| 729 class LinuxCoreDumpEnabler(PosixCoreDumpEnabler): | 730 class LinuxCoreDumpEnabler(PosixCoreDumpEnabler): |
| 730 def __enter__(self): | 731 def __enter__(self): |
| 732 pass |
| 731 # Bump core limits to unlimited if core_pattern is correctly configured. | 733 # Bump core limits to unlimited if core_pattern is correctly configured. |
| 732 if CheckLinuxCoreDumpPattern(fatal=False): | 734 # if CheckLinuxCoreDumpPattern(fatal=False): |
| 733 super(LinuxCoreDumpEnabler, self).__enter__() | 735 # super(LinuxCoreDumpEnabler, self).__enter__() |
| 734 | 736 |
| 735 def __exit__(self, *args): | 737 def __exit__(self, *args): |
| 736 # TODO(whesse): Re-enable after issue #30205 is addressed | 738 pass |
| 737 # CheckLinuxCoreDumpPattern(fatal=True) | 739 # CheckLinuxCoreDumpPattern(fatal=True) |
| 738 super(LinuxCoreDumpEnabler, self).__exit__(*args) | 740 # super(LinuxCoreDumpEnabler, self).__exit__(*args) |
| 739 | 741 |
| 740 class WindowsCoreDumpEnabler(object): | 742 class WindowsCoreDumpEnabler(object): |
| 741 """Configure Windows Error Reporting to store crash dumps. | 743 """Configure Windows Error Reporting to store crash dumps. |
| 742 | 744 |
| 743 The documentation can be found here: | 745 The documentation can be found here: |
| 744 https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181.aspx | 746 https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181.aspx |
| 745 """ | 747 """ |
| 746 | 748 |
| 747 WINDOWS_COREDUMP_FOLDER = r'crashes' | 749 WINDOWS_COREDUMP_FOLDER = r'crashes' |
| 748 | 750 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 return contextlib.nested(WindowsCoreDumpEnabler(), | 1040 return contextlib.nested(WindowsCoreDumpEnabler(), |
| 1039 WindowsCoreDumpArchiver()) | 1041 WindowsCoreDumpArchiver()) |
| 1040 else: | 1042 else: |
| 1041 # We don't have support for MacOS yet. | 1043 # We don't have support for MacOS yet. |
| 1042 assert osname == 'macos' | 1044 assert osname == 'macos' |
| 1043 return NooptCoreDumpArchiver() | 1045 return NooptCoreDumpArchiver() |
| 1044 | 1046 |
| 1045 if __name__ == "__main__": | 1047 if __name__ == "__main__": |
| 1046 import sys | 1048 import sys |
| 1047 Main() | 1049 Main() |
| OLD | NEW |