This is an archive of the discontinued LLVM Phabricator instance.

Fixed an issue where python would always use stdin, stdout and stderr
ClosedPublic

Authored by clayborg on Mar 10 2016, 11:37 AM.

Details

Reviewers
zturner
Summary

After the Python 3 fixes the interactive python interpreter stopped working in Xcode. The issue was the python interpreter tried to adopt the top IOHandler file handles, but it failed due to lldb_private::File objects failing to copy themselves into another lldb_private::File because they contained "FILE *" file stream pointer, not just an integer file descriptor, and File::Duplicate() didn't handle duplicating "FILE *". But we really don't want files duplicating themselves each time we run a python expression, we just want to use the files.

The fix involves removing File::Duplicate() since we shouldn't be using this and duplicating files. It also removes File's assignment operator and copy constructor. It then fixes the python interpreter to correctly adopt the file handles from the top IOHandler.

Diff Detail

Event Timeline

clayborg updated this revision to Diff 50320.Mar 10 2016, 11:37 AM
clayborg retitled this revision from to Fixed an issue where python would always use stdin, stdout and stderr.
clayborg updated this object.
clayborg added a reviewer: zturner.
clayborg added a subscriber: lldb-commits.
zturner accepted this revision.Mar 10 2016, 11:53 AM
zturner edited edge metadata.

Looks good, and it doesn't break anything on Windows. Glad we got rid of copying and duplication, that always seemed like unnecessary complexity.

This revision is now accepted and ready to land.Mar 10 2016, 11:53 AM
clayborg closed this revision.Mar 10 2016, 1:08 PM

Submitted with SVN revision 263161.