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

Side by Side Diff: native_client_sdk/src/tools/run.py

Issue 272243006: [NaCl SDK] Various fixes so "make debug" works on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge master Created 6 years, 7 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 | « native_client_sdk/src/tools/common.mk ('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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Launch a local server on an ephemeral port, then launch a executable that 6 """Launch a local server on an ephemeral port, then launch a executable that
7 points to that server. 7 points to that server.
8 """ 8 """
9 9
10 import copy 10 import copy
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 # If any debug args are passed in, assume we want to debug 68 # If any debug args are passed in, assume we want to debug
69 if options.debug: 69 if options.debug:
70 if getos.GetPlatform() == 'linux': 70 if getos.GetPlatform() == 'linux':
71 cmd = ['xterm', '-title', 'NaCl Debugger', '-e'] 71 cmd = ['xterm', '-title', 'NaCl Debugger', '-e']
72 cmd += options.debug 72 cmd += options.debug
73 elif getos.GetPlatform() == 'mac': 73 elif getos.GetPlatform() == 'mac':
74 cmd = ['osascript', '-e', 74 cmd = ['osascript', '-e',
75 'tell application "Terminal" to do script "%s"' % 75 'tell application "Terminal" to do script "%s"' %
76 ' '.join(r'\"%s\"' % x for x in options.debug)] 76 ' '.join(r'\"%s\"' % x for x in options.debug)]
77 else: 77 elif getos.GetPlatform() == 'win':
78 cmd = [] 78 cmd = ['cmd.exe', '/c', 'start', 'cmd.exe', '/c']
79 cmd += options.debug
79 print 'Starting debugger: ' + ' '.join(cmd) 80 print 'Starting debugger: ' + ' '.join(cmd)
80 debug_process = subprocess.Popen(cmd, env=env) 81 debug_process = subprocess.Popen(cmd, env=env)
81 else: 82 else:
82 debug_process = False 83 debug_process = False
83 84
84 try: 85 try:
85 return server.ServeUntilSubprocessDies(process) 86 return server.ServeUntilSubprocessDies(process)
86 finally: 87 finally:
87 if process.returncode is None: 88 if process.returncode is None:
88 process.kill() 89 process.kill()
89 if debug_process and debug_process.returncode is None: 90 if debug_process and debug_process.returncode is None:
90 debug_process.kill() 91 debug_process.kill()
91 92
92 if __name__ == '__main__': 93 if __name__ == '__main__':
93 sys.exit(main(sys.argv[1:])) 94 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « native_client_sdk/src/tools/common.mk ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698