Index: dart/tools/utils.py |
diff --git a/dart/tools/utils.py b/dart/tools/utils.py |
index 8f4a83ea90e9c47925a4d495d5e42013458020ca..0a3feba592bd7e46db2c7cac962c62729feffde5 100644 |
--- a/dart/tools/utils.py |
+++ b/dart/tools/utils.py |
@@ -264,6 +264,19 @@ class ToolError(Exception): |
return repr(self.value) |
+def IsCrashExitCode(exit_code): |
+ if IsWindows(): |
+ 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...
|
+ else: |
+ return exit_code < 0 |
+ |
+ |
+def DiagnoseExitCode(exit_code, command): |
+ if IsCrashExitCode(exit_code): |
+ sys.stderr.write('Command: %s\nCRASHED with exit code %d (0x%x)\n' % ( |
+ ' '.join(command), exit_code, exit_code & 0xffffffff)) |
+ |
+ |
if __name__ == "__main__": |
import sys |
Main(sys.argv) |