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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/tools/test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« 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