Fixed the python interpreter so that it correctly inherits the top IOHandler's files instead of always using stdin/out/err.

Removed lldb_private::File::Duplicate() and the copy constructor and the assignment operator that used to duplicate the file handles and made them private so no one uses them. Previously the lldb_private::File::Duplicate() function duplicated files that used file descriptors, (int) but not file streams (FILE *), so the lldb_private::File::Duplicate() function only worked some of the time. No one else excep thee ScriptInterpreterPython was using these functions, so that aren't needed nor desired. Previously every time you would drop into the python interpreter we would duplicate files, and now we avoid this file churn.

<rdar://problem/24877720>

llvm-svn: 263161
This commit is contained in:
Greg Clayton
2016-03-10 20:49:32 +00:00
parent ad04914a53
commit a31baf081b
4 changed files with 41 additions and 96 deletions

View File

@@ -581,6 +581,9 @@ protected:
bool
GetEmbeddedInterpreterModuleObjects ();
bool
SetStdHandle(File &file, const char *py_name, PythonFile &save_file, const char *mode);
PythonFile m_saved_stdin;
PythonFile m_saved_stdout;
PythonFile m_saved_stderr;