This revision was automatically updated to reflect the committed changes. Closed by commit rL372442: prepare_binding_Python: print readable errors if SWIG fails (authored by JDevlieghere, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D67790?vs=220940&id=221136#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67790/new/ https://reviews.llvm.org/D67790 Files: lldb/trunk/scripts/Python/prepare_binding_Python.py Index: lldb/trunk/scripts/Python/prepare_binding_Python.py =================================================================== --- lldb/trunk/scripts/Python/prepare_binding_Python.py +++ lldb/trunk/scripts/Python/prepare_binding_Python.py @@ -231,11 +231,13 @@ swig_stdout, swig_stderr = process.communicate() return_code = process.returncode if return_code != 0: + swig_stdout = swig_stdout.decode('utf8', errors='replace').rstrip() + swig_stderr = swig_stderr.decode('utf8', errors='replace').rstrip() + swig_stdout = re.sub(r'^(?=.)', 'stdout: ', swig_stdout, flags=re.MULTILINE) + swig_stderr = re.sub(r'^(?=.)', 'stderr: ', swig_stderr, flags=re.MULTILINE) logging.error( - "swig failed with error code %d: stdout=%s, stderr=%s", - return_code, - swig_stdout, - swig_stderr) + "swig failed with error code %d\n%s%s", + return_code, swig_stdout, swig_stderr) logging.error( "command line:\n%s", ' '.join(command)) sys.exit(return_code)
Index: lldb/trunk/scripts/Python/prepare_binding_Python.py =================================================================== --- lldb/trunk/scripts/Python/prepare_binding_Python.py +++ lldb/trunk/scripts/Python/prepare_binding_Python.py @@ -231,11 +231,13 @@ swig_stdout, swig_stderr = process.communicate() return_code = process.returncode if return_code != 0: + swig_stdout = swig_stdout.decode('utf8', errors='replace').rstrip() + swig_stderr = swig_stderr.decode('utf8', errors='replace').rstrip() + swig_stdout = re.sub(r'^(?=.)', 'stdout: ', swig_stdout, flags=re.MULTILINE) + swig_stderr = re.sub(r'^(?=.)', 'stderr: ', swig_stderr, flags=re.MULTILINE) logging.error( - "swig failed with error code %d: stdout=%s, stderr=%s", - return_code, - swig_stdout, - swig_stderr) + "swig failed with error code %d\n%s%s", + return_code, swig_stdout, swig_stderr) logging.error( "command line:\n%s", ' '.join(command)) sys.exit(return_code)
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits