Also dump the pid of the process launching through the lldbtest.system(*popenargs, **kwargs) API.

This helps track down possible zombie processes.

llvm-svn: 144846
This commit is contained in:
Johnny Chen 2011-11-16 22:41:53 +00:00
parent 35923d7864
commit 0bd8c311cb

View File

@ -296,6 +296,7 @@ def system(*popenargs, **kwargs):
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden.')
process = Popen(stdout=PIPE, stderr=PIPE, *popenargs, **kwargs)
pid = process.pid
output, error = process.communicate()
retcode = process.poll()
@ -306,6 +307,7 @@ def system(*popenargs, **kwargs):
args = list(popenargs)
print >> sbuf
print >> sbuf, "os command:", args
print >> sbuf, "with pid:", pid
print >> sbuf, "stdout:", output
print >> sbuf, "stderr:", error
print >> sbuf, "retcode:", retcode