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

Side by Side Diff: dart/tools/utils.py

Issue 9838017: Make a VM crash more obvious. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « dart/tools/test.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) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, 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 os 9 import os
10 import platform 10 import platform
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 class ToolError(Exception): 257 class ToolError(Exception):
258 """Deprecated exception, use Error instead.""" 258 """Deprecated exception, use Error instead."""
259 259
260 def __init__(self, value): 260 def __init__(self, value):
261 self.value = value 261 self.value = value
262 262
263 def __str__(self): 263 def __str__(self):
264 return repr(self.value) 264 return repr(self.value)
265 265
266 266
267 def IsCrashExitCode(exit_code):
268 if IsWindows():
269 return 0x80000000 & exit_code
Emily Fortuna 2012/03/22 20:40:48 where's the x8000000 coming from?
ahe 2012/03/22 20:46:32 I don't know. All I know is that this is in test.p
Emily Fortuna 2012/03/22 20:47:45 Curious. Sgtm...
270 else:
271 return exit_code < 0
272
273
274 def DiagnoseExitCode(exit_code, command):
275 if IsCrashExitCode(exit_code):
276 sys.stderr.write('Command: %s\nCRASHED with exit code %d (0x%x)\n' % (
277 ' '.join(command), exit_code, exit_code & 0xffffffff))
278
279
267 if __name__ == "__main__": 280 if __name__ == "__main__":
268 import sys 281 import sys
269 Main(sys.argv) 282 Main(sys.argv)
OLDNEW
« no previous file with comments | « dart/tools/test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698